Skip to content

Commit 10bb3b7

Browse files
committed
forgot to actually implement the test assertions
1 parent d22b8e3 commit 10bb3b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/paginate.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,14 @@ describe('paginate', () => {
700700
const result = await paginate<CatEntity>(query, catRepo, config)
701701

702702
expect(result.meta.sortBy).toStrictEqual([['home.countCat', 'DESC']])
703-
expect(result.data).toStrictEqual([cats[3], cats[4], cats[1], cats[0], cats[2]])
703+
const expected = [cats[0], cats[1], cats[2], cats[3], cats[4]].map(clone)
704+
expected.forEach((cat) => (cat.home = null))
705+
catHomes.forEach((home, i) => {
706+
expected[i].home = clone(home)
707+
expected[i].home.countCat = 1
708+
delete expected[i].home.cat
709+
})
710+
expect(result.data).toStrictEqual(expected)
704711
})
705712

706713
it('should sort result by camelcase columns', async () => {

0 commit comments

Comments
 (0)