Last active
March 14, 2019 08:00
-
-
Save cop1fab/5b66bc7ca5f7f2496a42a2e12b3d928d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import chai from 'chai'; | |
import chaiHttp from 'chai-http'; | |
import app from '../../app'; | |
const { | |
expect | |
} = chai; | |
chai.use(chaiHttp); | |
let token = ''; | |
/* like and article*/ | |
describe('like', () => { | |
it('it should upvote an article', (done) => { | |
chai.request(app) | |
.patch('/api/v1/article/1/like') | |
.set('access-token', token) | |
.end((err, res) => { | |
expect(res.status).to.equal(200); | |
done(); | |
}); | |
}); | |
}); // end of test | |
/* Dislike an article*/ | |
describe('dislike', () => { | |
it('it should dislike an article', (done) => { | |
chai.request(app) | |
.patch('/api/v1/article/1/dislike') | |
.set('access-token', token) | |
.end((err, res) => { | |
expect(res.status).to.equal(200); | |
done(); | |
}); | |
}); | |
}); // end of test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment