mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-18 01:18:23 +02:00
adding tests
This commit is contained in:
parent
26c9bfa3c8
commit
5e6e7e1aac
@ -302,3 +302,16 @@ test('Sorts environments correctly if sort order is equal', async () => {
|
|||||||
expect(feature.environments[1].name).toBe(envTwo);
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -39,6 +39,7 @@ test('should create new project', async () => {
|
|||||||
expect(project.name).toEqual(ret.name);
|
expect(project.name).toEqual(ret.name);
|
||||||
expect(project.description).toEqual(ret.description);
|
expect(project.description).toEqual(ret.description);
|
||||||
expect(ret.createdAt).toBeTruthy();
|
expect(ret.createdAt).toBeTruthy();
|
||||||
|
expect(ret.updatedAt).toBeTruthy();
|
||||||
expect(exists).toBe(true);
|
expect(exists).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user