1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-31 01:16:01 +02:00

adding tests

This commit is contained in:
Youssef 2021-12-01 10:41:41 +01:00
parent 26c9bfa3c8
commit 5e6e7e1aac
2 changed files with 14 additions and 0 deletions

View File

@ -302,3 +302,16 @@ test('Sorts environments correctly if sort order is equal', async () => {
expect(feature.environments[1].name).toBe(envTwo);
});
});
test('Update update_at when setHealth runs', async () => {
await app.services.projectHealthService.setHealthRating();
await app.request
.get('/api/admin/projects/default/health-report')
.expect(200)
.expect('Content-Type', /json/)
.expect((res) => {
let now = new Date().getTime();
let updatedAt = new Date(res.body.updatedAt).getTime();
expect(now - updatedAt).toBeLessThan(5000);
});
});

View File

@ -39,6 +39,7 @@ test('should create new project', async () => {
expect(project.name).toEqual(ret.name);
expect(project.description).toEqual(ret.description);
expect(ret.createdAt).toBeTruthy();
expect(ret.updatedAt).toBeTruthy();
expect(exists).toBe(true);
});