Adjusted tests for the new responseType parameter (part 3)

ref #132
This commit is contained in:
Nicolai Ort 2021-01-30 16:19:20 +01:00
parent ff8af090e3
commit 8dc2810c0c
7 changed files with 7 additions and 7 deletions

View File

@ -136,6 +136,7 @@ describe('POST /api/contacts working (with group)', () => {
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
delete res.data.id;
delete res.data.groups[0].teams;
expect(res.data).toEqual({
"firstname": "first",
"middlename": null,
@ -189,6 +190,7 @@ describe('POST /api/contacts working (with group)', () => {
expect(res.headers['content-type']).toContain("application/json");
added_contact = res.data
delete res.data.id;
delete res.data.groups[0].teams;
expect(res.data).toEqual({
"firstname": "first",
"middlename": null,

View File

@ -86,7 +86,8 @@ describe('Update contact group after adding (should work)', () => {
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
added_contact = res.data
added_contact = res.data;
delete res.data.groups[0].teams;
expect(res.data).toEqual({
"id": res.data.id,
"firstname": "first",
@ -141,6 +142,7 @@ describe('Update contact group after adding (should work)', () => {
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
delete res.data.groups[0].teams;
expect(res.data).toEqual({
"id": res.data.id,
"firstname": "first",

View File

@ -323,7 +323,6 @@ describe('adding + updating distance donation valid', () => {
"amountPerDistance": 69,
"donor": added_donor.id
}, axios_config);
delete res.data.runner;
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
expect(res.data.runner).toEqual(added_runner2);

View File

@ -17,7 +17,6 @@ beforeAll(async () => {
describe('GET /api/runners', () => {
it('basic get should return 200', async () => {
const res = await axios.get(base + '/api/runners', axios_config);
console.log(res.data)
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});

View File

@ -129,9 +129,8 @@ describe('GET /api/teams/:id/runners after adding', () => {
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
it('check if scans was added via the orgs/runners endpoint.', async () => {
it('check if runner was added via the teams/runners endpoint.', async () => {
const res = await axios.get(base + '/api/teams/' + added_team.id + "/runners", axios_config);
console.log(res.data);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
expect(res.data).toContainEqual(added_runner);

View File

@ -72,7 +72,7 @@ describe('adding + getting scans', () => {
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
added_scan.runner.distance = 0;
added_scan.runner.group = added_org;
delete added_scan.runner.group;
expect(res.data).toContainEqual(added_scan);
});
});

View File

@ -242,7 +242,6 @@ describe('POST /api/scans successfully via scan station', () => {
headers: { "authorization": "Bearer " + added_station.key },
validateStatus: undefined
});
console.log(res.data)
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
expect(res.data.valid).toEqual(false);