1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-23 00:16:25 +01:00

fix: update e2e test for splash

This commit is contained in:
Youssef 2021-11-12 11:18:09 +01:00
parent fc275a6183
commit e0356eff6d

View File

@ -41,40 +41,11 @@ afterAll(async () => {
await db.destroy();
});
test('it creates splash for user', async () => {
expect.assertions(1);
return app.request
.post('/api/admin/splash')
.send({ splashId: 'environment' })
.set('Content-Type', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
expect(res.body.splashId).toBe('environment');
});
});
test('it gives 400 when splash is not present', async () => {
expect.assertions(1);
return app.request
.post('/api/admin/splash')
.send({})
.set('Content-Type', 'application/json')
.expect('Content-Type', /json/)
.expect(400)
.expect((res) => {
expect(res.body.error).toBeTruthy();
});
});
test('it updates splash for user', async () => {
expect.assertions(1);
return app.request
.put('/api/admin/splash/environment')
.send({ seen: true })
.post('/api/admin/splash/environment')
.set('Content-Type', 'application/json')
.expect('Content-Type', /json/)
.expect(200)