Skip to content

Commit

Permalink
ci: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogan AY committed Dec 16, 2024
1 parent 3012047 commit c96a345
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/plugin-flattener/test/flatten-column.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import flattenColumn from '../src/flatten-column';
const logger = () => {};

// Working around a bug from a decorator which rewrites search in filters
const filter = factories.filter.build({ search: null as unknown as undefined });
const filter = factories.filter.build({
search: null as unknown as undefined,
segment: null as unknown as undefined,
});
const caller = factories.caller.build();

describe('flattenColumn', () => {
Expand Down Expand Up @@ -293,12 +296,20 @@ describe('flattenColumn', () => {
expect(baseUpdate).toHaveBeenCalledWith(
caller,
// not sure why I need to specify search == null. It's related to a bug in a decorator.
{ conditionTree: { field: 'id', operator: 'Equal', value: '1' }, search: null },
{
conditionTree: { field: 'id', operator: 'Equal', value: '1' },
search: null,
segment: null,
},
{ author: { name: 'Tolkien', address: { city: 'New York' } } },
);
expect(baseUpdate).toHaveBeenCalledWith(
caller,
{ conditionTree: { field: 'id', operator: 'In', value: ['2', '3'] }, search: null },
{
conditionTree: { field: 'id', operator: 'In', value: ['2', '3'] },
search: null,
segment: null,
},
{ author: { name: 'Tolkien' } },
);
});
Expand Down

0 comments on commit c96a345

Please sign in to comment.