| @@ -17,11 +17,11 @@ beforeAll(async () => { | ||||
| describe('Update runner name after adding', () => { | ||||
|     let added_org; | ||||
|     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" | ||||
|         }, axios_config); | ||||
|         delete res1.data.registrationEnabled; | ||||
|         added_org = res1.data | ||||
|         expect(res1.status).toEqual(200); | ||||
|         expect(res1.headers['content-type']).toContain("application/json") | ||||
| @@ -43,11 +43,13 @@ describe('Update runner name after adding', () => { | ||||
|         const res3 = await axios.put(base + '/api/runners/' + added_runner.id, runnercopy, axios_config); | ||||
|         expect(res3.status).toEqual(200); | ||||
|         expect(res3.headers['content-type']).toContain("application/json") | ||||
|         updated_runner = res3.data; | ||||
|         delete added_org.contact; | ||||
|         delete added_org.teams; | ||||
|         runnercopy.group = added_org; | ||||
|         expect(updated_runner).toEqual(runnercopy); | ||||
|         delete res3.data.group.key; | ||||
|         delete res3.data.group.registrationEnabled; | ||||
|         delete runnercopy.group.registrationEnabled; | ||||
|         expect(res3.data).toEqual(runnercopy); | ||||
|     }); | ||||
| }); | ||||
| // --------------- | ||||
| @@ -86,9 +88,12 @@ describe('Update runner group after adding', () => { | ||||
|     }); | ||||
|     it('valid group update should return 200', async () => { | ||||
|         added_runner.group = added_org_2.id; | ||||
|         delete added_org_2.registrationEnabled; | ||||
|         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") | ||||
|         delete res3.data.group.key; | ||||
|         delete res3.data.group.registrationEnabled; | ||||
|         expect(res3.data.group).toEqual(added_org_2); | ||||
|     }); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user