mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
add simple e2e tests
This commit is contained in:
parent
07dc23d23d
commit
e6915658c9
@ -98,6 +98,24 @@ test.serial('can change status of feature toggle that does exist', async t => {
|
|||||||
.expect(200).then(destroy);
|
.expect(200).then(destroy);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.serial('can not toggle of feature that does not exist', async t => {
|
||||||
|
const { request, destroy } = await setupApp('feature_api_serial');
|
||||||
|
logger.setLevel('FATAL');
|
||||||
|
return request
|
||||||
|
.post('/features/should-not-exist/toggle')
|
||||||
|
.set('Content-Type', 'application/json')
|
||||||
|
.expect(404).then(destroy);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.serial('can toggle a feature that does exist', async t => {
|
||||||
|
const { request, destroy } = await setupApp('feature_api_serial');
|
||||||
|
logger.setLevel('FATAL');
|
||||||
|
return request
|
||||||
|
.post('/features/featureY/toggle')
|
||||||
|
.set('Content-Type', 'application/json')
|
||||||
|
.expect(200).then(destroy);
|
||||||
|
});
|
||||||
|
|
||||||
test.serial('archives a feature by name', async t => {
|
test.serial('archives a feature by name', async t => {
|
||||||
const { request, destroy } = await setupApp('feature_api_serial');
|
const { request, destroy } = await setupApp('feature_api_serial');
|
||||||
return request
|
return request
|
||||||
|
Loading…
Reference in New Issue
Block a user