From 323e28b7943e4163fd4d06f713d944443b6dd073 Mon Sep 17 00:00:00 2001 From: ppetzold Date: Sat, 14 May 2022 19:52:16 +0200 Subject: [PATCH] fix tests --- src/paginate.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/paginate.spec.ts b/src/paginate.spec.ts index e1358ec..f806521 100644 --- a/src/paginate.spec.ts +++ b/src/paginate.spec.ts @@ -36,8 +36,8 @@ describe('paginate', () => { catToyRepo = connection.getRepository(CatToyEntity) catHomeRepo = connection.getRepository(CatHomeEntity) cats = await catRepo.save([ - catRepo.create({ name: 'Milo', color: 'brown', age: 6 }), - catRepo.create({ name: 'Garfield', color: 'ginger', age: 5 }), + catRepo.create({ name: 'Milo', color: 'brown', age: 6, createdAt: '2022-01-01' }), + catRepo.create({ name: 'Garfield', color: 'ginger', age: 5, createdAt: '2022-01-02' }), catRepo.create({ name: 'Shadow', color: 'black', age: 4 }), catRepo.create({ name: 'George', color: 'white', age: 3 }), catRepo.create({ name: 'Leche', color: 'white', age: null }), @@ -511,7 +511,7 @@ describe('paginate', () => { relations: ['cat'], sortableColumns: ['id', 'name'], filterableColumns: { - 'cat.age': [FilterOperator.BTW], + createdAt: [FilterOperator.BTW], }, } const query: PaginateQuery = { @@ -526,7 +526,7 @@ describe('paginate', () => { expect(result.meta.filter).toStrictEqual({ 'cat.age': '$btw:6,10', }) - expect(result.data).toStrictEqual([catHomes[0]]) + expect(result.data).toStrictEqual([catHomes[0], catHomes[1]]) expect(result.links.current).toBe('?page=1&limit=20&sortBy=id:ASC&filter.cat.age=$btw:6,10') })