From e6915658c92dae064ced12af4599215b970d7e5f Mon Sep 17 00:00:00 2001 From: sveisvei Date: Mon, 9 Jan 2017 11:28:48 +0100 Subject: [PATCH] add simple e2e tests --- test/e2e/feature-api.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/e2e/feature-api.test.js b/test/e2e/feature-api.test.js index 7b00d0e51c..172e48840c 100644 --- a/test/e2e/feature-api.test.js +++ b/test/e2e/feature-api.test.js @@ -98,6 +98,24 @@ test.serial('can change status of feature toggle that does exist', async t => { .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 => { const { request, destroy } = await setupApp('feature_api_serial'); return request