Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Relaties', () => {
- describe('Ophalen alle relaties met: GET /api/ehrm-klantnr/relatie', () => {
- it('should get alle relaties', (done) => {
- let agent = chai.request.agent(app)
- agent
- .put('/api/ehrm-klantnr/medewerker/login')
- .send({ email: 'admin@sfgtest.com', wachtwoord: 'Test#111111' })
- .then(function (res) {
- expect(res).to.have.cookie('SESSIONID');
- // The `agent` now has the sessionid cookie saved, and will send it
- // back to the server in the next request:
- return agent.get('/api/ehrm-klantnr/relatie')
- .set('meta','1')
- .then(function (res) {
- expect(res).to.have.status(200);
- expect(res.body.data[0].vestiging).to.equal('Slib Hoofdkantoor');
- done();
- });
- });
- });
- });
- });
- describe('Relaties', () => {
- let agent = chai.request.agent(app);
- describe('First this one', function () {
- beforeEach(function () {
- console.log('outer describe - beforeEach');
- agent
- .put('/api/ehrm-klantnr/medewerker/login')
- .send({ email: 'admin@sfgtest.com', wachtwoord: 'Test#111111' })
- .then(function (res) {
- expect(res).to.have.cookie('SESSIONID');
- });
- });
- });
- describe('Ophalen alle relaties met: GET /api/ehrm-klantnr/relatie', () => {
- it('should get alle relaties', (done) => {
- return agent.get('/api/ehrm-klantnr/relatie')
- .set('meta', '1')
- .then(function (res) {
- expect(res).to.have.status(200);
- expect(res.body.data[0].vestiging).to.equal('Slib Hoofdkantoor');
- done();
- });
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement