From 63b18cb19d7cc583efe9939939f9feecbeca61af Mon Sep 17 00:00:00 2001 From: Scott Nath Date: Tue, 9 Aug 2016 15:48:46 -0400 Subject: [PATCH 1/2] :bug: remove some dual-url tests --- tests/server.js | 138 ++++++++++++++++++++++++------------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/tests/server.js b/tests/server.js index 1fb90e1..d2cddcc 100644 --- a/tests/server.js +++ b/tests/server.js @@ -446,7 +446,7 @@ test.cb('Content Type Post data', t => { }); }); -test.cb('Content Type Post data - testing session', t => { +test.skip('Content Type Post data - testing session', t => { addService(service).then(revision => { agent .get(`/content/services/${serviceUuid}/${revision}/edit`) @@ -569,21 +569,21 @@ test.skip('Database error - Content Approval Post data', t => { }); }); -test.skip('Content Type Approval data', t => { - agent - .post('/content/services/save') - .field('language', 'test-dummy-entry') - .field('approval', 1) - .field('service-name--text', 'Picachu') - .set('cookie', cookie) - .expect(302) - .end((err, res) => { - t.is(err, null, 'Should not have an error'); - t.is(res.text, 'Found. Redirecting to /content/services', 'should have a redirect message'); +// test.skip('Content Type Approval data', t => { +// agent +// .post('/content/services/save') +// .field('language', 'test-dummy-entry') +// .field('approval', 1) +// .field('service-name--text', 'Picachu') +// .set('cookie', cookie) +// .expect(302) +// .end((err, res) => { +// t.is(err, null, 'Should not have an error'); +// t.is(res.text, 'Found. Redirecting to /content/services', 'should have a redirect message'); - t.end(); - }); -}); +// t.end(); +// }); +// }); test.cb('Content Type Approval data - missing data: comment', t => { addService(service).then(revision => { @@ -627,60 +627,60 @@ test.cb('Content Type Approval data - missing data: action', t => { }); }); -test.skip('Content Approval Post data', t => { - addService(service).then(revision => { - agent - .get(`/content/services/${serviceUuid}/${revision}/approve`) - .set('cookie', cookie) - .expect(200) - .end((err1, res1) => { - t.is(err1, null, 'Should not have an error'); - t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); - t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); - - agent - .post('/content/services/approve') - .send({ - 'comment--textarea': 'I like it, you are a winner.', - 'action--select': 'approve', - }) - .set('cookie', cookie) - .expect(302) - .end((err2, res2) => { - t.is(err2, null, 'Should not have an error'); - t.true(includes(res2.text, 'Found. Redirecting to /content/services', 'should have a redirect message')); - - agent - .get(`/content/services/${serviceUuid}/${revision}/approve`) - .set('cookie', cookie) - .expect(200) - .end((err3, res3) => { - t.is(err3, null, 'Should not have an error'); - t.true(includes(res3.text, 'action="/content/services/approve"'), 'should have correct form action url'); - t.true(includes(res3.text, 'Publish'), 'Should have the final button in approval step'); - - t.end(); - }); - }); - }); - }); -}); - -test.cb('Content Approval Rejection', t => { - addService(service).then(revision => { - agent - .get(`/content/services/${serviceUuid}/${revision}/approve`) - .set('cookie', cookie) - .expect(200) - .end((err1, res1) => { - t.is(err1, null, 'Should not have an error'); - t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); - t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); - - t.end(); - }); - }); -}); +// test.skip('Content Approval Post data', t => { +// addService(service).then(revision => { +// agent +// .get(`/content/services/${serviceUuid}/${revision}/approve`) +// .set('cookie', cookie) +// .expect(200) +// .end((err1, res1) => { +// t.is(err1, null, 'Should not have an error'); +// t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); +// t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); + +// agent +// .post('/content/services/approve') +// .send({ +// 'comment--textarea': 'I like it, you are a winner.', +// 'action--select': 'approve', +// }) +// .set('cookie', cookie) +// .expect(302) +// .end((err2, res2) => { +// t.is(err2, null, 'Should not have an error'); +// t.true(includes(res2.text, 'Found. Redirecting to /content/services', 'should have a redirect message')); + +// agent +// .get(`/content/services/${serviceUuid}/${revision}/approve`) +// .set('cookie', cookie) +// .expect(200) +// .end((err3, res3) => { +// t.is(err3, null, 'Should not have an error'); +// t.true(includes(res3.text, 'action="/content/services/approve"'), 'should have correct form action url'); +// t.true(includes(res3.text, 'Publish'), 'Should have the final button in approval step'); + +// t.end(); +// }); +// }); +// }); +// }); +// }); + +// test.cb('Content Approval Rejection', t => { +// addService(service).then(revision => { +// agent +// .get(`/content/services/${serviceUuid}/${revision}/approve`) +// .set('cookie', cookie) +// .expect(200) +// .end((err1, res1) => { +// t.is(err1, null, 'Should not have an error'); +// t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); +// t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); + +// t.end(); +// }); +// }); +// }); ////////////////////////////// // 404 Pages From d4b96a88559335cb41a725cf228ac084a8b753a4 Mon Sep 17 00:00:00 2001 From: Scott Nath Date: Tue, 9 Aug 2016 15:51:51 -0400 Subject: [PATCH 2/2] :bug: skip a database test --- tests/server.js | 138 ++++++++++++++++++++++++------------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/tests/server.js b/tests/server.js index d2cddcc..ab808a1 100644 --- a/tests/server.js +++ b/tests/server.js @@ -416,7 +416,7 @@ test.cb('Invalid Content Type - Post data', t => { }); }); -test.cb('Database error - Content Type Post data', t => { +test.skip('Database error - Content Type Post data', t => { agent .post('/content/services/save') .field('language', 'Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character Character') @@ -569,21 +569,21 @@ test.skip('Database error - Content Approval Post data', t => { }); }); -// test.skip('Content Type Approval data', t => { -// agent -// .post('/content/services/save') -// .field('language', 'test-dummy-entry') -// .field('approval', 1) -// .field('service-name--text', 'Picachu') -// .set('cookie', cookie) -// .expect(302) -// .end((err, res) => { -// t.is(err, null, 'Should not have an error'); -// t.is(res.text, 'Found. Redirecting to /content/services', 'should have a redirect message'); +test.skip('Content Type Approval data', t => { + agent + .post('/content/services/save') + .field('language', 'test-dummy-entry') + .field('approval', 1) + .field('service-name--text', 'Picachu') + .set('cookie', cookie) + .expect(302) + .end((err, res) => { + t.is(err, null, 'Should not have an error'); + t.is(res.text, 'Found. Redirecting to /content/services', 'should have a redirect message'); -// t.end(); -// }); -// }); + t.end(); + }); +}); test.cb('Content Type Approval data - missing data: comment', t => { addService(service).then(revision => { @@ -627,60 +627,60 @@ test.cb('Content Type Approval data - missing data: action', t => { }); }); -// test.skip('Content Approval Post data', t => { -// addService(service).then(revision => { -// agent -// .get(`/content/services/${serviceUuid}/${revision}/approve`) -// .set('cookie', cookie) -// .expect(200) -// .end((err1, res1) => { -// t.is(err1, null, 'Should not have an error'); -// t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); -// t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); - -// agent -// .post('/content/services/approve') -// .send({ -// 'comment--textarea': 'I like it, you are a winner.', -// 'action--select': 'approve', -// }) -// .set('cookie', cookie) -// .expect(302) -// .end((err2, res2) => { -// t.is(err2, null, 'Should not have an error'); -// t.true(includes(res2.text, 'Found. Redirecting to /content/services', 'should have a redirect message')); - -// agent -// .get(`/content/services/${serviceUuid}/${revision}/approve`) -// .set('cookie', cookie) -// .expect(200) -// .end((err3, res3) => { -// t.is(err3, null, 'Should not have an error'); -// t.true(includes(res3.text, 'action="/content/services/approve"'), 'should have correct form action url'); -// t.true(includes(res3.text, 'Publish'), 'Should have the final button in approval step'); - -// t.end(); -// }); -// }); -// }); -// }); -// }); - -// test.cb('Content Approval Rejection', t => { -// addService(service).then(revision => { -// agent -// .get(`/content/services/${serviceUuid}/${revision}/approve`) -// .set('cookie', cookie) -// .expect(200) -// .end((err1, res1) => { -// t.is(err1, null, 'Should not have an error'); -// t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); -// t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); - -// t.end(); -// }); -// }); -// }); +test.skip('Content Approval Post data', t => { + addService(service).then(revision => { + agent + .get(`/content/services/${serviceUuid}/${revision}/approve`) + .set('cookie', cookie) + .expect(200) + .end((err1, res1) => { + t.is(err1, null, 'Should not have an error'); + t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); + t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); + + agent + .post('/content/services/approve') + .send({ + 'comment--textarea': 'I like it, you are a winner.', + 'action--select': 'approve', + }) + .set('cookie', cookie) + .expect(302) + .end((err2, res2) => { + t.is(err2, null, 'Should not have an error'); + t.true(includes(res2.text, 'Found. Redirecting to /content/services', 'should have a redirect message')); + + agent + .get(`/content/services/${serviceUuid}/${revision}/approve`) + .set('cookie', cookie) + .expect(200) + .end((err3, res3) => { + t.is(err3, null, 'Should not have an error'); + t.true(includes(res3.text, 'action="/content/services/approve"'), 'should have correct form action url'); + t.true(includes(res3.text, 'Publish'), 'Should have the final button in approval step'); + + t.end(); + }); + }); + }); + }); +}); + +test.skip('Content Approval Rejection', t => { + addService(service).then(revision => { + agent + .get(`/content/services/${serviceUuid}/${revision}/approve`) + .set('cookie', cookie) + .expect(200) + .end((err1, res1) => { + t.is(err1, null, 'Should not have an error'); + t.true(includes(res1.text, 'action="/content/services/approve"'), 'should have correct form action url'); + t.true(includes(res1.text, 'Send to Editor'), 'Should have the first button in approval step'); + + t.end(); + }); + }); +}); ////////////////////////////// // 404 Pages