Switched tests over to the new id-only schema
All checks were successful
continuous-integration/drone/pr Build is passing

ref #90
This commit is contained in:
2021-01-15 18:50:35 +01:00
parent 420e9c4662
commit d88fb18319
3 changed files with 20 additions and 15 deletions

View File

@@ -43,7 +43,7 @@ describe('adding + updating name', () => {
"id": added_team_id,
"name": "testlelele",
"contact": null,
"parentGroup": added_org
"parentGroup": added_org.id
}, axios_config);
expect(res3.status).toEqual(200);
expect(res3.headers['content-type']).toContain("application/json")
@@ -79,6 +79,7 @@ describe('adding + try updating id (should return 406)', () => {
});
it('update team', async () => {
added_team.id = added_team.id + 1;
added_team.parentGroup = added_team.parentGroup.id;
const res3 = await axios.put(base + '/api/teams/' + added_team_id, added_team, axios_config);
expect(res3.status).toEqual(406);
expect(res3.headers['content-type']).toContain("application/json")
@@ -117,7 +118,7 @@ describe('add+update parent org (valid)', () => {
expect(res3.headers['content-type']).toContain("application/json")
});
it('update team', async () => {
added_team.parentGroup = added_org2;
added_team.parentGroup = added_org2.id;
const res4 = await axios.put(base + '/api/teams/' + added_team_id, added_team, axios_config);
let updated_team = res4.data;
expect(res4.status).toEqual(200);
@@ -125,6 +126,6 @@ describe('add+update parent org (valid)', () => {
delete added_org2.address;
delete added_org2.contact;
delete added_org2.teams;
expect(updated_team).toEqual(added_team)
expect(updated_team.parentGroup).toEqual(added_org2)
});
});