Removed addresses from tests until the circular dependencies are solved
ref #65
This commit is contained in:
parent
2594a607dc
commit
599296c4e3
|
@ -29,7 +29,7 @@ export class RunnerOrganisationController {
|
|||
@OpenAPI({ description: 'Lists all organisations. <br> This includes their address, contact and teams (if existing/associated).' })
|
||||
async getAll() {
|
||||
let responseTeams: ResponseRunnerOrganisation[] = new Array<ResponseRunnerOrganisation>();
|
||||
const runners = await this.runnerOrganisationRepository.find({ relations: ['address', 'contact', 'teams'] });
|
||||
const runners = await this.runnerOrganisationRepository.find({ relations: [/*'address',*/ 'contact', 'teams'] });
|
||||
runners.forEach(runner => {
|
||||
responseTeams.push(new ResponseRunnerOrganisation(runner));
|
||||
});
|
||||
|
@ -43,7 +43,7 @@ export class RunnerOrganisationController {
|
|||
@OnUndefined(RunnerOrganisationNotFoundError)
|
||||
@OpenAPI({ description: 'Lists all information about the organisation whose id got provided.' })
|
||||
async getOne(@Param('id') id: number) {
|
||||
let runnerOrg = await this.runnerOrganisationRepository.findOne({ id: id }, { relations: ['address', 'contact', 'teams'] });
|
||||
let runnerOrg = await this.runnerOrganisationRepository.findOne({ id: id }, { relations: [/*'address',*/ 'contact', 'teams'] });
|
||||
if (!runnerOrg) { throw new RunnerOrganisationNotFoundError(); }
|
||||
return new ResponseRunnerOrganisation(runnerOrg);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ export class RunnerOrganisationController {
|
|||
|
||||
runnerOrganisation = await this.runnerOrganisationRepository.save(runnerOrganisation);
|
||||
|
||||
return new ResponseRunnerOrganisation(await this.runnerOrganisationRepository.findOne(runnerOrganisation, { relations: ['address', 'contact', 'teams'] }));
|
||||
return new ResponseRunnerOrganisation(await this.runnerOrganisationRepository.findOne(runnerOrganisation, { relations: [/*'address',*/ 'contact', 'teams'] }));
|
||||
}
|
||||
|
||||
@Put('/:id')
|
||||
|
@ -84,7 +84,7 @@ export class RunnerOrganisationController {
|
|||
|
||||
await this.runnerOrganisationRepository.save(await updateOrganisation.updateRunnerOrganisation(oldRunnerOrganisation));
|
||||
|
||||
return new ResponseRunnerOrganisation(await this.runnerOrganisationRepository.findOne(id, { relations: ['address', 'contact', 'teams'] }));
|
||||
return new ResponseRunnerOrganisation(await this.runnerOrganisationRepository.findOne(id, { relations: [/*'address',*/ 'contact', 'teams'] }));
|
||||
}
|
||||
|
||||
@Delete('/:id')
|
||||
|
@ -98,7 +98,7 @@ export class RunnerOrganisationController {
|
|||
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||
let organisation = await this.runnerOrganisationRepository.findOne({ id: id });
|
||||
if (!organisation) { return null; }
|
||||
let runnerOrganisation = await this.runnerOrganisationRepository.findOne(organisation, { relations: ['address', 'contact', 'runners', 'teams'] });
|
||||
let runnerOrganisation = await this.runnerOrganisationRepository.findOne(organisation, { relations: [/*'address',*/ 'contact', 'runners', 'teams'] });
|
||||
|
||||
if (!force) {
|
||||
if (runnerOrganisation.teams.length != 0) {
|
||||
|
|
|
@ -56,7 +56,7 @@ describe('adding + getting from all orgs', () => {
|
|||
expect(added_org).toEqual({
|
||||
"name": "test123",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
"teams": []
|
||||
})
|
||||
});
|
||||
|
@ -83,7 +83,7 @@ describe('adding + getting explicitly', () => {
|
|||
expect(added_org2).toEqual({
|
||||
"name": "test123",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
"teams": []
|
||||
})
|
||||
});
|
||||
|
|
|
@ -44,7 +44,7 @@ describe('adding + deletion (successfull)', () => {
|
|||
expect(added_org2).toEqual({
|
||||
"name": "test123",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
"teams": []
|
||||
});
|
||||
});
|
||||
|
@ -121,7 +121,7 @@ describe('adding + deletion with teams still existing (with force)', () => {
|
|||
expect(added_org2).toEqual({
|
||||
"name": "test123",
|
||||
"contact": null,
|
||||
"address": null
|
||||
// "address": null
|
||||
});
|
||||
});
|
||||
it('check if org really was deleted', async () => {
|
||||
|
|
|
@ -32,7 +32,7 @@ describe('adding + updating name', () => {
|
|||
"id": added_org_id,
|
||||
"name": "testlelele",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
}, axios_config);
|
||||
expect(res2.status).toEqual(200);
|
||||
expect(res2.headers['content-type']).toContain("application/json")
|
||||
|
@ -42,7 +42,7 @@ describe('adding + updating name', () => {
|
|||
expect(added_org2).toEqual({
|
||||
"name": "testlelele",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
"teams": []
|
||||
})
|
||||
});
|
||||
|
@ -65,7 +65,7 @@ describe('adding + try updating id (should return 406)', () => {
|
|||
"id": added_org_id + 1,
|
||||
"name": "testlelele",
|
||||
"contact": null,
|
||||
"address": null,
|
||||
// "address": null,
|
||||
}, axios_config);
|
||||
expect(res2.status).toEqual(406);
|
||||
expect(res2.headers['content-type']).toContain("application/json")
|
||||
|
|
Loading…
Reference in New Issue