Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Aug 27, 2020
1 parent 7a28d51 commit 29a07d7
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test/issue.tests/356.campaign.spec.ts
Expand Up @@ -3,6 +3,7 @@ import * as express from 'express';
import * as request from 'supertest';
import { createApp } from '../common/app';
import * as packageJson from '../../package.json';
import { expect } from 'chai';

describe(packageJson.name, () => {
let app = null;
Expand Down Expand Up @@ -30,14 +31,30 @@ describe(packageJson.name, () => {
app.server.close();
});

it('create campaign should return 201', async () => request(app)
it('create campaign should return 201', async () =>
request(app)
.post(`/campaign`)
.send({
name: 'test',
description: 'description',
startDate: '2020-08-25T20:37:33.117Z',
endDate: '2020-08-25T20:37:33.117Z',
})
.expect(201)
);
.expect(201));

it('create campaign should return 400', async () =>
request(app)
.post(`/campaign`)
.send({
campaign: {
name: 'test',
description: 'description',
startDate: '2020-08-25T20:37:33.117Z',
endDate: '2020-08-25T20:37:33.117Z',
},
})
.expect(400)
.then((r) => {
expect(r.body.message).to.include('name');
}));
});

0 comments on commit 29a07d7

Please sign in to comment.