Skip to content

Commit

Permalink
bug(cleanup) clean up test codes
Browse files Browse the repository at this point in the history
[Starts Finishes #168033876]
  • Loading branch information
salviosage committed Aug 21, 2019
1 parent 8e73746 commit e870b8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
19 changes: 0 additions & 19 deletions test/like.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('/likes and dislikes feature', () => {
password: 'ASqw12345'
})
.end((error, res) => {
if (error) done(error);
usertoken = `Bearer ${res.body.token}`;
expect(res.status).to.be.equal(200);
expect(res.body).to.have.deep.property('message');
Expand All @@ -30,7 +29,6 @@ describe('/likes and dislikes feature', () => {
password: 'ASqw12345'
})
.end((error, res) => {
if (error) done(error);
mikeToken = `Bearer ${res.body.token}`;
expect(res.status).to.be.equal(200);
expect(res.body).to.have.deep.property('message');
Expand All @@ -46,7 +44,6 @@ describe('/likes and dislikes feature', () => {
password: 'ASqw12345'
})
.end((error, res) => {
if (error) done(error);
adminToken = `Bearer ${res.body.token}`;
expect(res.status).to.be.equal(200);
expect(res.body).to.have.deep.property('message');
Expand All @@ -60,7 +57,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', `21${usertoken}`)
.end((error, res) => {
if (error) done(error);
expect(res.status).to.be.equal(401);
expect(res.body).to.have.deep.property('message');
done();
Expand All @@ -73,7 +69,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', `${adminToken}`)
.end((error, res) => {
if (error) done(error);
expect(res.status).to.be.equal(401);
expect(res.body).to.have.deep.property('message');
expect(res.body.message).to.deep.equal('You can not clap to your own post');
Expand All @@ -86,7 +81,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/dislike/fakeslug')
.set('x-access-token', `${adminToken}`)
.end((error, res) => {
if (error) done(error);
expect(res.status).to.be.equal(401);
expect(res.body).to.have.deep.property('message');
expect(res.body.message).to.deep.equal('You can not dislike to your own post');
Expand All @@ -99,7 +93,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/unlike/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(401);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status');
Expand All @@ -113,7 +106,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -131,7 +123,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -149,7 +140,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/unlike/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -167,7 +157,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/dislike/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -184,7 +173,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/dislike/fakeslug')
.set('Authorization', mikeToken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -201,7 +189,6 @@ describe('/likes and dislikes feature', () => {
.get('/api/v1/likes/dislikes/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'data', 'status');
Expand All @@ -216,7 +203,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/dislike/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -235,7 +221,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/unlike/fakesl')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(404);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status');
Expand All @@ -249,7 +234,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', mikeToken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -266,7 +250,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -283,7 +266,6 @@ describe('/likes and dislikes feature', () => {
.put('/api/v1/likes/clap/fakeslug')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -300,7 +282,6 @@ describe('/likes and dislikes feature', () => {
.get('/api/v1/likes/claps/fakeslug')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'data', 'status');
Expand Down
8 changes: 0 additions & 8 deletions test/user.profile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('/Create Profile feature', () => {
password: 'ASqw12345'
})
.end((error, res) => {
if (error) done(error);
usertoken = `Bearer ${res.body.token}`;
expect(res.status).to.be.equal(200);
expect(res.body).to.have.deep.property('message');
Expand All @@ -30,7 +29,6 @@ describe('/Create Profile feature', () => {
username: 123454
})
.end((error, res) => {
if (error) done(error);
expect(res).to.be.an('object');
expect(res.status).to.equal(400);
expect(res.body)
Expand All @@ -46,7 +44,6 @@ describe('/Create Profile feature', () => {
.put('/api/v1/profile')
.set('x-access-token', `21${usertoken}`)
.end((error, res) => {
if (error) done(error);
expect(res.status).to.be.equal(401);
expect(res.body).to.have.deep.property('message');
done();
Expand All @@ -59,7 +56,6 @@ describe('/Create Profile feature', () => {
.get('/api/v1/profile/admin')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand All @@ -76,7 +72,6 @@ describe('/Create Profile feature', () => {
.field('bio', 'I am a software developer based in kigali, i like data science and AI')
.field('username', 'admin')
.end((error, res) => {
if (error) done(error);
expect(res).to.be.an('object');
expect(res.status).to.equal(409);
expect(res.body.message).to.deep.equal(
Expand Down Expand Up @@ -126,7 +121,6 @@ describe('/Create Profile feature', () => {
.field('bio', 'I am a software developer based in kigali, i like data science and AI')
.field('username', 'salvi')
.end((error, res) => {
if (error) done(error);
expect(res).to.be.an('object');
expect(res.status).to.equal(200);
expect(res.body.data).to.have.property('bio');
Expand All @@ -141,7 +135,6 @@ describe('/Create Profile feature', () => {
.get('/api/v1/profile/mikki')
.set('Authorization', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(404);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status');
Expand All @@ -155,7 +148,6 @@ describe('/Create Profile feature', () => {
.get('/api/v1/profile/authors')
.set('x-access-token', usertoken)
.end((error, res) => {
if (error) done(error);
expect(res).have.status(200);
expect(res).to.be.an('object');
expect(res.body).to.have.keys('message', 'status', 'data');
Expand Down

0 comments on commit e870b8a

Please sign in to comment.