chore(): 1.0.0
This commit is contained in:
@@ -13,7 +13,8 @@ vi.mock('../../../shared/PDF-functions', () => ({
|
||||
getContentTable: vi.fn(),
|
||||
getTable: vi.fn(),
|
||||
getValue: vi.fn((v) => v?._text || v),
|
||||
getTStawkaPodatku: vi.fn()
|
||||
getTStawkaPodatku: vi.fn(),
|
||||
getDifferentColumnsValue: vi.fn(),
|
||||
}));
|
||||
|
||||
describe(generateWiersze.name, () => {
|
||||
@@ -62,7 +63,7 @@ describe(generateWiersze.name, () => {
|
||||
vi.mocked(PDFFunctions.createSection).mockReturnValue({ section: 'content' } as any);
|
||||
vi.mocked(PDFFunctions.createLabelTextArray).mockReturnValue(['Label', 'Value'] as any);
|
||||
vi.mocked(PDFFunctions.getTStawkaPodatku).mockReturnValue('0' as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getDifferentColumnsValue).mockReturnValue([]);
|
||||
};
|
||||
|
||||
describe('when no invoice lines exist', () => {
|
||||
@@ -73,6 +74,7 @@ describe(generateWiersze.name, () => {
|
||||
fieldsWithValue: [],
|
||||
});
|
||||
vi.mocked(PDFFunctions.getValue).mockReturnValue('0');
|
||||
vi.mocked(PDFFunctions.getDifferentColumnsValue).mockReturnValue([]);
|
||||
|
||||
const result = generateWiersze(mockFaVat);
|
||||
|
||||
@@ -110,7 +112,9 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should display "brutto" when P_11 is not in fieldsWithValue', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([
|
||||
{ NrWierszaFa: { _text: '1' }, P_12: { _text: '23' } },
|
||||
] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable).mockReturnValue({
|
||||
content: { table: {} } as any,
|
||||
@@ -152,7 +156,9 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should generate two tables when fieldsWithValue.length > 8', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([
|
||||
{ NrWierszaFa: { _text: '1' }, P_12: { _text: '23' } },
|
||||
] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable)
|
||||
.mockReturnValueOnce({
|
||||
@@ -179,7 +185,9 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should not add second table if it has only 1 field with value', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([
|
||||
{ NrWierszaFa: { _text: '1' }, P_12: { _text: '23' } },
|
||||
] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable)
|
||||
.mockReturnValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user