Skip to content

Commit

Permalink
Address review comments (Shungo)
Browse files Browse the repository at this point in the history
- added spaces between test cases
  • Loading branch information
isaachan100 committed Apr 24, 2023
1 parent 18940eb commit f99c5a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tests/flyer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ describe('getAllFlyer tests:', () => {
const getFlyersResponse = await FlyerRepo.getAllFlyers();
expect(getFlyersResponse).toHaveLength(0);
});

test('getAllFlyers - 5 flyers', async () => {
const flyers = await FlyerFactory.create(5);
await FlyerModel.insertMany(flyers);

const getFlyersResponse = await FlyerRepo.getAllFlyers();
expect(getFlyersResponse).toHaveLength(5);
});

test('getAllFlyers limit 2', async () => {
const flyers = await FlyerFactory.create(3);
await FlyerModel.insertMany(flyers);

const getFlyersResponse = await FlyerRepo.getAllFlyers(0, 2);
expect(getFlyersResponse).toHaveLength(2);
});

test('getAllFlyers - Sort by date desc, offset 2, limit 2', async () => {
const flyers = await FlyerFactory.create(5);
flyers.sort(FactoryUtils.compareByDate);
Expand All @@ -68,6 +71,7 @@ describe('getFlyer(s)ByID(s) tests:', () => {
const getFlyersResponse = await FlyerRepo.getFlyerByID(id);
expect(getFlyersResponse.title).toEqual(flyers[0].title);
});

test('getFlyersByIDs - 3 flyers', async () => {
const flyers = await FlyerFactory.create(3);
const insertOutput = await FlyerModel.insertMany(flyers);
Expand Down

0 comments on commit f99c5a0

Please sign in to comment.