mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
fix: update e2e test for splash
This commit is contained in:
parent
fc275a6183
commit
e0356eff6d
@ -41,40 +41,11 @@ afterAll(async () => {
|
|||||||
await db.destroy();
|
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 () => {
|
test('it updates splash for user', async () => {
|
||||||
expect.assertions(1);
|
expect.assertions(1);
|
||||||
|
|
||||||
return app.request
|
return app.request
|
||||||
.put('/api/admin/splash/environment')
|
.post('/api/admin/splash/environment')
|
||||||
.send({ seen: true })
|
|
||||||
.set('Content-Type', 'application/json')
|
.set('Content-Type', 'application/json')
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
Loading…
Reference in New Issue
Block a user