| @@ -29,16 +29,6 @@ describe('POST /api/donors with errors', () => { | ||||
|         expect(res2.status).toEqual(400); | ||||
|         expect(res2.headers['content-type']).toContain("application/json") | ||||
|     }); | ||||
|     it('creating a new donor with a invalid address should return 404', async () => { | ||||
|         const res2 = await axios.post(base + '/api/donors', { | ||||
|             "firstname": "first", | ||||
|             "middlename": "middle", | ||||
|             "lastname": "last", | ||||
|             "address": 99999999999999999999999999 | ||||
|         }, axios_config); | ||||
|         expect(res2.status).toEqual(404); | ||||
|         expect(res2.headers['content-type']).toContain("application/json") | ||||
|     }); | ||||
|     it('creating a new donor with a invalid phone number should return 400', async () => { | ||||
|         const res2 = await axios.post(base + '/api/donors', { | ||||
|             "firstname": "first", | ||||
|   | ||||
| @@ -56,7 +56,13 @@ describe('adding + getting from all orgs', () => { | ||||
|         expect(added_org).toEqual({ | ||||
|             "name": "test123", | ||||
|             "contact": null, | ||||
|             "address": null, | ||||
|             "address": { | ||||
|                 "address1": null, | ||||
|                 "address2": null, | ||||
|                 "city": null, | ||||
|                 "country": null, | ||||
|                 "postalcode": null, | ||||
|             }, | ||||
|             "teams": [] | ||||
|         }) | ||||
|     }); | ||||
| @@ -83,7 +89,13 @@ describe('adding + getting explicitly', () => { | ||||
|         expect(added_org2).toEqual({ | ||||
|             "name": "test123", | ||||
|             "contact": null, | ||||
|             "address": null, | ||||
|             "address": { | ||||
|                 "address1": null, | ||||
|                 "address2": null, | ||||
|                 "city": null, | ||||
|                 "country": null, | ||||
|                 "postalcode": null, | ||||
|             }, | ||||
|             "teams": [] | ||||
|         }) | ||||
|     }); | ||||
|   | ||||
| @@ -44,7 +44,13 @@ describe('adding + deletion (successfull)', () => { | ||||
|         expect(added_org2).toEqual({ | ||||
|             "name": "test123", | ||||
|             "contact": null, | ||||
|             "address": null, | ||||
|             "address": { | ||||
|                 "address1": null, | ||||
|                 "address2": null, | ||||
|                 "city": null, | ||||
|                 "country": null, | ||||
|                 "postalcode": null, | ||||
|             }, | ||||
|             "teams": [] | ||||
|         }); | ||||
|     }); | ||||
| @@ -121,7 +127,13 @@ describe('adding + deletion with teams still existing (with force)', () => { | ||||
|         expect(added_org2).toEqual({ | ||||
|             "name": "test123", | ||||
|             "contact": null, | ||||
|             "address": null | ||||
|             "address": { | ||||
|                 "address1": null, | ||||
|                 "address2": null, | ||||
|                 "city": null, | ||||
|                 "country": null, | ||||
|                 "postalcode": null, | ||||
|             }, | ||||
|         }); | ||||
|     }); | ||||
|     it('check if org really was deleted', async () => { | ||||
|   | ||||
| @@ -42,7 +42,13 @@ describe('adding + updating name', () => { | ||||
|         expect(added_org2).toEqual({ | ||||
|             "name": "testlelele", | ||||
|             "contact": null, | ||||
|             "address": null, | ||||
|             "address": { | ||||
|                 "address1": null, | ||||
|                 "address2": null, | ||||
|                 "city": null, | ||||
|                 "country": null, | ||||
|                 "postalcode": null, | ||||
|             }, | ||||
|             "teams": [] | ||||
|         }) | ||||
|     }); | ||||
|   | ||||
| @@ -123,7 +123,6 @@ describe('add+update parent org (valid)', () => { | ||||
|         let updated_team = res4.data; | ||||
|         expect(res4.status).toEqual(200); | ||||
|         expect(res4.headers['content-type']).toContain("application/json") | ||||
|         delete added_org2.address; | ||||
|         delete added_org2.contact; | ||||
|         delete added_org2.teams; | ||||
|         expect(updated_team.parentGroup).toEqual(added_org2) | ||||
|   | ||||
| @@ -44,7 +44,6 @@ describe('Update runner name after adding', () => { | ||||
|         expect(res3.status).toEqual(200); | ||||
|         expect(res3.headers['content-type']).toContain("application/json") | ||||
|         updated_runner = res3.data; | ||||
|         delete added_org.address; | ||||
|         delete added_org.contact; | ||||
|         delete added_org.teams; | ||||
|         runnercopy.group = added_org; | ||||
| @@ -56,7 +55,6 @@ describe('Update runner group after adding', () => { | ||||
|     let added_org_id; | ||||
|     let added_org_2; | ||||
|     let added_runner; | ||||
|     let updated_runner; | ||||
|     it('creating a new org with just a name should return 200', async () => { | ||||
|         const res1 = await axios.post(base + '/api/organisations', { | ||||
|             "name": "test123" | ||||
| @@ -81,7 +79,6 @@ describe('Update runner group after adding', () => { | ||||
|             "name": "test123" | ||||
|         }, axios_config); | ||||
|         added_org_2 = res3.data | ||||
|         delete added_org_2.address; | ||||
|         delete added_org_2.contact; | ||||
|         delete added_org_2.teams; | ||||
|         expect(res3.status).toEqual(200); | ||||
| @@ -92,8 +89,7 @@ describe('Update runner group after adding', () => { | ||||
|         const res3 = await axios.put(base + '/api/runners/' + added_runner.id, added_runner, axios_config); | ||||
|         expect(res3.status).toEqual(200); | ||||
|         expect(res3.headers['content-type']).toContain("application/json") | ||||
|         updated_runner = res3.data | ||||
|         expect(updated_runner.group).toEqual(added_org_2); | ||||
|         expect(res3.data.group).toEqual(added_org_2); | ||||
|     }); | ||||
| }); | ||||
| // --------------- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user