Merged PR 1853: feat(return-process): add getReceiptItemQuantity helper and related tests

feat(return-process): add getReceiptItemQuantity helper and related tests

Ref: #5156
This commit is contained in:
Lorenz Hilpert
2025-06-10 14:56:34 +00:00
committed by Nino Righi
parent a37201ef33
commit 61ce9940c9
9 changed files with 190 additions and 102 deletions

View File

@@ -1,4 +1,8 @@
import { createComponentFactory, Spectator, mockProvider } from '@ngneat/spectator/jest';
import {
createComponentFactory,
Spectator,
mockProvider,
} from '@ngneat/spectator/jest';
import { FilterActionsComponent } from './filter-actions.component';
import { FilterService } from '../core';
@@ -13,7 +17,6 @@ describe('FilterActionsComponent', () => {
{ group: 'other', key: 'key2' },
]),
commit: jest.fn(),
commitInput: jest.fn(),
reset: jest.fn(),
resetInput: jest.fn(),
}),
@@ -51,7 +54,7 @@ describe('FilterActionsComponent', () => {
spectator.setInput('inputKey', 'key1');
spectator.component.onApply();
expect(filterService.commitInput).toHaveBeenCalledWith('key1');
expect(filterService.commit).toHaveBeenCalled();
expect(appliedSpy).toHaveBeenCalled();
});
@@ -74,7 +77,7 @@ describe('FilterActionsComponent', () => {
spectator.setInput('inputKey', 'key1');
spectator.component.onReset();
expect(filterService.resetInput).toHaveBeenCalledWith('key1');
expect(filterService.resetInput).toHaveBeenCalledWith(['key1']);
expect(filterService.commit).toHaveBeenCalled();
expect(resetedSpy).toHaveBeenCalled();
});