mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1873: #4769 Remission List
- feat(remission-list): Zwischencommit - feat(ui-input-controls): Adjusted Dropdown Styling and Added Droption Option Disable Class, Refs: #4769 - feat(remission): implement remission list feature shell and category select - Merge branch 'develop' into feature/4769-Remission-Liste - Merge branch 'develop' into feature/4769-Remission-Liste - feat(remission-list, remission-data-access): implement new remission data access layer and update remission list integration
This commit is contained in:
committed by
Lorenz Hilpert
parent
a68f5b5347
commit
f34f2164fc
@@ -6,22 +6,28 @@ import * as orderByOptionMappingModule from './order-by-option.mapping';
|
||||
|
||||
describe('filterMapping', () => {
|
||||
// Mock implementations for each specific mapping function
|
||||
const mockFilterGroupMapping = jest.fn().mockImplementation((group: InputGroup) => ({
|
||||
group: group.group,
|
||||
label: group.label,
|
||||
mapped: 'group',
|
||||
}));
|
||||
const mockFilterGroupMapping = jest
|
||||
.fn()
|
||||
.mockImplementation((group: InputGroup) => ({
|
||||
group: group.group,
|
||||
label: group.label,
|
||||
mapped: 'group',
|
||||
}));
|
||||
|
||||
const mockFilterInputMapping = jest.fn().mockImplementation((group, input) => ({
|
||||
group,
|
||||
key: input.key,
|
||||
mapped: 'input',
|
||||
}));
|
||||
const mockFilterInputMapping = jest
|
||||
.fn()
|
||||
.mockImplementation((group, input) => ({
|
||||
group,
|
||||
key: input.key,
|
||||
mapped: 'input',
|
||||
}));
|
||||
|
||||
const mockOrderByOptionMapping = jest.fn().mockImplementation((orderBy: OrderBy) => ({
|
||||
by: orderBy.by,
|
||||
mapped: 'orderBy',
|
||||
}));
|
||||
const mockOrderByOptionMapping = jest
|
||||
.fn()
|
||||
.mockImplementation((orderBy: OrderBy) => ({
|
||||
by: orderBy.by,
|
||||
mapped: 'orderBy',
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
@@ -84,8 +90,14 @@ describe('filterMapping', () => {
|
||||
expect(mockFilterGroupMapping).toHaveBeenCalledTimes(1);
|
||||
expect(mockFilterGroupMapping).toHaveBeenCalledWith(settings.filter[0]);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledTimes(2);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith('group1', settings.filter[0].input[0]);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith('group1', settings.filter[0].input[1]);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith(
|
||||
'group1',
|
||||
settings.filter[0].input[0],
|
||||
);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith(
|
||||
'group1',
|
||||
settings.filter[0].input[1],
|
||||
);
|
||||
expect(mockOrderByOptionMapping).not.toHaveBeenCalled();
|
||||
|
||||
expect(result).toEqual({
|
||||
@@ -133,7 +145,10 @@ describe('filterMapping', () => {
|
||||
expect(mockFilterGroupMapping).toHaveBeenCalledTimes(1);
|
||||
expect(mockFilterGroupMapping).toHaveBeenCalledWith(settings.input[0]);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledTimes(1);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith('group2', settings.input[0].input[0]);
|
||||
expect(mockFilterInputMapping).toHaveBeenCalledWith(
|
||||
'group2',
|
||||
settings.input[0].input[0],
|
||||
);
|
||||
expect(mockOrderByOptionMapping).not.toHaveBeenCalled();
|
||||
|
||||
expect(result).toEqual({
|
||||
@@ -173,8 +188,14 @@ describe('filterMapping', () => {
|
||||
expect(mockFilterGroupMapping).not.toHaveBeenCalled();
|
||||
expect(mockFilterInputMapping).not.toHaveBeenCalled();
|
||||
expect(mockOrderByOptionMapping).toHaveBeenCalledTimes(2);
|
||||
expect(mockOrderByOptionMapping).toHaveBeenNthCalledWith(1, settings.orderBy[0]);
|
||||
expect(mockOrderByOptionMapping).toHaveBeenNthCalledWith(2, settings.orderBy[1]);
|
||||
expect(mockOrderByOptionMapping).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
settings.orderBy[0],
|
||||
);
|
||||
expect(mockOrderByOptionMapping).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
settings.orderBy[1],
|
||||
);
|
||||
|
||||
expect(result).toEqual({
|
||||
groups: [],
|
||||
@@ -200,7 +221,9 @@ describe('filterMapping', () => {
|
||||
{
|
||||
group: 'input1',
|
||||
label: 'Input 1',
|
||||
input: [{ key: 'input2', label: 'Input 2', type: InputType.Checkbox }],
|
||||
input: [
|
||||
{ key: 'input2', label: 'Input 2', type: InputType.Checkbox },
|
||||
],
|
||||
},
|
||||
],
|
||||
orderBy: [{ label: 'Sort by Name', by: 'name', desc: false }],
|
||||
|
||||
Reference in New Issue
Block a user