diff --git a/src/controllers/ImportController.ts b/src/controllers/ImportController.ts index 3390e46..b620253 100644 --- a/src/controllers/ImportController.ts +++ b/src/controllers/ImportController.ts @@ -36,7 +36,7 @@ export class ImportController { return responseRunners; } - @Post('/organisations/:id/import') + @Post('/organizations/:id/import') @ContentType("application/json") @ResponseSchema(ResponseRunner, { isArray: true, statusCode: 200 }) @ResponseSchema(RunnerGroupNotFoundError, { statusCode: 404 }) @@ -78,7 +78,7 @@ export class ImportController { return await this.postJSON(importRunners, groupID); } - @Post('/organisations/:id/import/csv') + @Post('/organizations/:id/import/csv') @ContentType("application/json") @UseBefore(RawBodyMiddleware) @ResponseSchema(ResponseRunner, { isArray: true, statusCode: 200 }) diff --git a/src/controllers/RunnerOrganisationController.ts b/src/controllers/RunnerOrganisationController.ts index 4d985e4..71465f2 100644 --- a/src/controllers/RunnerOrganisationController.ts +++ b/src/controllers/RunnerOrganisationController.ts @@ -11,7 +11,7 @@ import { RunnerController } from './RunnerController'; import { RunnerTeamController } from './RunnerTeamController'; -@JsonController('/organisations') +@JsonController('/organizations') @OpenAPI({ security: [{ "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) export class RunnerOrganisationController { private runnerOrganisationRepository: Repository; @@ -26,7 +26,7 @@ export class RunnerOrganisationController { @Get() @Authorized("ORGANISATION:GET") @ResponseSchema(ResponseRunnerOrganisation, { isArray: true }) - @OpenAPI({ description: 'Lists all organisations.
This includes their address, contact and teams (if existing/associated).' }) + @OpenAPI({ description: 'Lists all organizations.
This includes their address, contact and teams (if existing/associated).' }) async getAll() { let responseTeams: ResponseRunnerOrganisation[] = new Array(); const runners = await this.runnerOrganisationRepository.find({ relations: ['contact', 'teams'] }); @@ -41,7 +41,7 @@ export class RunnerOrganisationController { @ResponseSchema(ResponseRunnerOrganisation) @ResponseSchema(RunnerOrganisationNotFoundError, { statusCode: 404 }) @OnUndefined(RunnerOrganisationNotFoundError) - @OpenAPI({ description: 'Lists all information about the organisation whose id got provided.' }) + @OpenAPI({ description: 'Lists all information about the organization whose id got provided.' }) async getOne(@Param('id') id: number) { let runnerOrg = await this.runnerOrganisationRepository.findOne({ id: id }, { relations: ['contact', 'teams'] }); if (!runnerOrg) { throw new RunnerOrganisationNotFoundError(); } @@ -70,7 +70,7 @@ export class RunnerOrganisationController { @ResponseSchema(ResponseRunnerOrganisation) @ResponseSchema(RunnerOrganisationNotFoundError, { statusCode: 404 }) @ResponseSchema(RunnerOrganisationIdsNotMatchingError, { statusCode: 406 }) - @OpenAPI({ description: "Update the organisation whose id you provided.
Please remember that ids can't be changed." }) + @OpenAPI({ description: "Update the organization whose id you provided.
Please remember that ids can't be changed." }) async put(@Param('id') id: number, @Body({ validate: true }) updateOrganisation: UpdateRunnerOrganisation) { let oldRunnerOrganisation = await this.runnerOrganisationRepository.findOne({ id: id }); @@ -94,11 +94,11 @@ export class RunnerOrganisationController { @ResponseSchema(RunnerOrganisationHasTeamsError, { statusCode: 406 }) @ResponseSchema(RunnerOrganisationHasRunnersError, { statusCode: 406 }) @OnUndefined(204) - @OpenAPI({ description: 'Delete the organsisation whose id you provided.
If the organisation still has runners and/or teams associated this will fail.
To delete the organisation with all associated runners and teams set the force QueryParam to true (cascading deletion might take a while).
This won\'t delete the associated contact.
If no organisation with this id exists it will just return 204(no content).' }) + @OpenAPI({ description: 'Delete the organsisation whose id you provided.
If the organization still has runners and/or teams associated this will fail.
To delete the organization with all associated runners and teams set the force QueryParam to true (cascading deletion might take a while).
This won\'t delete the associated contact.
If no organization with this id exists it will just return 204(no content).' }) 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: ['contact', 'runners', 'teams'] }); + let organization = await this.runnerOrganisationRepository.findOne({ id: id }); + if (!organization) { return null; } + let runnerOrganisation = await this.runnerOrganisationRepository.findOne(organization, { relations: ['contact', 'runners', 'teams'] }); if (!force) { if (runnerOrganisation.teams.length != 0) { @@ -121,7 +121,7 @@ export class RunnerOrganisationController { } const responseOrganisation = new ResponseRunnerOrganisation(runnerOrganisation); - await this.runnerOrganisationRepository.delete(organisation); + await this.runnerOrganisationRepository.delete(organization); return responseOrganisation; } } diff --git a/src/controllers/RunnerSelfServiceController.ts b/src/controllers/RunnerSelfServiceController.ts index 07789ee..eb5070d 100644 --- a/src/controllers/RunnerSelfServiceController.ts +++ b/src/controllers/RunnerSelfServiceController.ts @@ -53,7 +53,7 @@ export class RunnerSelfServiceController { @Post('/register/:token') @ResponseSchema(ResponseSelfServiceRunner) @ResponseSchema(RunnerOrganisationNotFoundError, { statusCode: 404 }) - @OpenAPI({ description: 'Create a new selfservice runner in a provided org.
The orgs get provided and authorized via api tokens that can be optained via the /organisations endpoint.' }) + @OpenAPI({ description: 'Create a new selfservice runner in a provided org.
The orgs get provided and authorized via api tokens that can be optained via the /organizations endpoint.' }) async registerOrganisationRunner(@Param('token') token: string, @Body({ validate: true }) createRunner: CreateSelfServiceRunner) { const org = await this.getOrgansisation(token); @@ -85,14 +85,14 @@ export class RunnerSelfServiceController { /** * Get's a runner org by a provided registration api key. - * @param token The organisation's registration api token. + * @param token The organization's registration api token. */ private async getOrgansisation(token: string): Promise { token = Buffer.from(token, 'base64').toString('utf8'); - const organisation = await this.orgRepository.findOne({ key: token }); - if (!organisation) { throw new RunnerOrganisationNotFoundError; } + const organization = await this.orgRepository.findOne({ key: token }); + if (!organization) { throw new RunnerOrganisationNotFoundError; } - return organisation; + return organization; } } \ No newline at end of file diff --git a/src/controllers/RunnerTeamController.ts b/src/controllers/RunnerTeamController.ts index ce706ec..e4952ac 100644 --- a/src/controllers/RunnerTeamController.ts +++ b/src/controllers/RunnerTeamController.ts @@ -25,7 +25,7 @@ export class RunnerTeamController { @Get() @Authorized("TEAM:GET") @ResponseSchema(ResponseRunnerTeam, { isArray: true }) - @OpenAPI({ description: 'Lists all teams.
This includes their parent organisation and contact (if existing/associated).' }) + @OpenAPI({ description: 'Lists all teams.
This includes their parent organization and contact (if existing/associated).' }) async getAll() { let responseTeams: ResponseRunnerTeam[] = new Array(); const runners = await this.runnerTeamRepository.find({ relations: ['parentGroup', 'contact'] }); diff --git a/src/controllers/StatsController.ts b/src/controllers/StatsController.ts index 127949d..d0cf8b6 100644 --- a/src/controllers/StatsController.ts +++ b/src/controllers/StatsController.ts @@ -94,10 +94,10 @@ export class StatsController { return responseTeams; } - @Get("/organisations/distance") + @Get("/organizations/distance") @UseBefore(StatsAuth) @ResponseSchema(ResponseStatsOrgnisation, { isArray: true }) - @OpenAPI({ description: "Returns the top ten organisations by distance.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) + @OpenAPI({ description: "Returns the top ten organizations by distance.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) async getTopOrgsByDistance() { let orgs = await getConnection().getRepository(RunnerOrganisation).find({ relations: ['runners', 'runners.scans', 'runners.distanceDonations', 'runners.scans.track', 'teams', 'teams.runners', 'teams.runners.scans', 'teams.runners.distanceDonations', 'teams.runners.scans.track'] }); let topOrgs = orgs.sort((org1, org2) => org1.distance - org2.distance).slice(0, 9); @@ -108,10 +108,10 @@ export class StatsController { return responseOrgs; } - @Get("/organisations/donations") + @Get("/organizations/donations") @UseBefore(StatsAuth) @ResponseSchema(ResponseStatsOrgnisation, { isArray: true }) - @OpenAPI({ description: "Returns the top ten organisations by donations.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) + @OpenAPI({ description: "Returns the top ten organizations by donations.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] }) async getTopOrgsByDonations() { let orgs = await getConnection().getRepository(RunnerOrganisation).find({ relations: ['runners', 'runners.scans', 'runners.distanceDonations', 'runners.scans.track', 'teams', 'teams.runners', 'teams.runners.scans', 'teams.runners.distanceDonations', 'teams.runners.scans.track'] }); let topOrgs = orgs.sort((org1, org2) => org1.distanceDonationAmount - org2.distanceDonationAmount).slice(0, 9); diff --git a/src/errors/RunnerErrors.ts b/src/errors/RunnerErrors.ts index 12621f0..7be9048 100644 --- a/src/errors/RunnerErrors.ts +++ b/src/errors/RunnerErrors.ts @@ -32,7 +32,7 @@ export class RunnerGroupNeededError extends NotAcceptableError { name = "RunnerGroupNeededError" @IsString() - message = "Runner's need to be part of one group (team or organisation)! \n You provided neither." + message = "Runner's need to be part of one group (team or organization)! \n You provided neither." } /** diff --git a/src/errors/RunnerOrganisationErrors.ts b/src/errors/RunnerOrganisationErrors.ts index 081fbf0..b815900 100644 --- a/src/errors/RunnerOrganisationErrors.ts +++ b/src/errors/RunnerOrganisationErrors.ts @@ -2,7 +2,7 @@ import { IsString } from 'class-validator'; import { NotAcceptableError, NotFoundError } from 'routing-controllers'; /** - * Error to throw when a runner organisation couldn't be found. + * Error to throw when a runner organization couldn't be found. */ export class RunnerOrganisationNotFoundError extends NotFoundError { @IsString() @@ -13,37 +13,37 @@ export class RunnerOrganisationNotFoundError extends NotFoundError { } /** - * Error to throw when two runner organisation's ids don't match. - * Usually occurs when a user tries to change a runner organisation's id. + * Error to throw when two runner organization's ids don't match. + * Usually occurs when a user tries to change a runner organization's id. */ export class RunnerOrganisationIdsNotMatchingError extends NotAcceptableError { @IsString() name = "RunnerOrganisationIdsNotMatchingError" @IsString() - message = "The ids don't match! \n And if you wanted to change a runner organisation's id: This isn't allowed!" + message = "The ids don't match! \n And if you wanted to change a runner organization's id: This isn't allowed!" } /** - * Error to throw when a organisation still has runners associated. + * Error to throw when a organization still has runners associated. */ export class RunnerOrganisationHasRunnersError extends NotAcceptableError { @IsString() name = "RunnerOrganisationHasRunnersError" @IsString() - message = "This organisation still has runners associated with it. \n If you want to delete this organisation with all it's runners and teams add `?force` to your query." + message = "This organization still has runners associated with it. \n If you want to delete this organization with all it's runners and teams add `?force` to your query." } /** - * Error to throw when a organisation still has teams associated. + * Error to throw when a organization still has teams associated. */ export class RunnerOrganisationHasTeamsError extends NotAcceptableError { @IsString() name = "RunnerOrganisationHasTeamsError" @IsString() - message = "This organisation still has teams associated with it. \n If you want to delete this organisation with all it's runners and teams add `?force` to your query." + message = "This organization still has teams associated with it. \n If you want to delete this organization with all it's runners and teams add `?force` to your query." } /** @@ -54,5 +54,5 @@ export class RunnerOrganisationWrongTypeError extends NotAcceptableError { name = "RunnerOrganisationWrongTypeError" @IsString() - message = "The runner organisation must be an existing organisation's id. \n You provided a object of another type." + message = "The runner organization must be an existing organization's id. \n You provided a object of another type." } diff --git a/src/errors/RunnerTeamErrors.ts b/src/errors/RunnerTeamErrors.ts index a00a9be..a137ef3 100644 --- a/src/errors/RunnerTeamErrors.ts +++ b/src/errors/RunnerTeamErrors.ts @@ -43,5 +43,5 @@ export class RunnerTeamNeedsParentError extends NotAcceptableError { name = "RunnerTeamNeedsParentError" @IsString() - message = "You provided no runner organisation as this team's parent group." + message = "You provided no runner organization as this team's parent group." } \ No newline at end of file diff --git a/src/models/actions/create/CreateRunnerOrganisation.ts b/src/models/actions/create/CreateRunnerOrganisation.ts index 58b406c..e1a2e15 100644 --- a/src/models/actions/create/CreateRunnerOrganisation.ts +++ b/src/models/actions/create/CreateRunnerOrganisation.ts @@ -10,14 +10,14 @@ import { CreateRunnerGroup } from './CreateRunnerGroup'; */ export class CreateRunnerOrganisation extends CreateRunnerGroup { /** - * The new organisation's address. + * The new organization's address. */ @IsOptional() @IsObject() address?: Address; /** - * Is registration enabled for the new organisation? + * Is registration enabled for the new organization? */ @IsOptional() @IsBoolean() diff --git a/src/models/actions/update/UpdateRunnerOrganisation.ts b/src/models/actions/update/UpdateRunnerOrganisation.ts index ade982c..72acdba 100644 --- a/src/models/actions/update/UpdateRunnerOrganisation.ts +++ b/src/models/actions/update/UpdateRunnerOrganisation.ts @@ -17,14 +17,14 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup { id: number; /** - * The updated organisation's address. + * The updated organization's address. */ @IsOptional() @IsObject() address?: Address; /** - * Is registration enabled for the updated organisation? + * Is registration enabled for the updated organization? */ @IsOptional() @IsBoolean() @@ -33,21 +33,21 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup { /** * Updates a provided RunnerOrganisation entity based on this. */ - public async update(organisation: RunnerOrganisation): Promise { + public async update(organization: RunnerOrganisation): Promise { - organisation.name = this.name; - organisation.contact = await this.getContact(); - if (!this.address) { organisation.address.reset(); } - else { organisation.address = this.address; } - Address.validate(organisation.address); + organization.name = this.name; + organization.contact = await this.getContact(); + if (!this.address) { organization.address.reset(); } + else { organization.address = this.address; } + Address.validate(organization.address); - if (this.registrationEnabled && !organisation.key) { - organisation.key = uuid.v4().toUpperCase(); + if (this.registrationEnabled && !organization.key) { + organization.key = uuid.v4().toUpperCase(); } else { - organisation.key = null; + organization.key = null; } - return organisation; + return organization; } } \ No newline at end of file diff --git a/src/models/entities/Runner.ts b/src/models/entities/Runner.ts index 266abb9..ad16eae 100644 --- a/src/models/entities/Runner.ts +++ b/src/models/entities/Runner.ts @@ -16,7 +16,7 @@ import { Scan } from "./Scan"; export class Runner extends Participant { /** * The runner's associated group. - * Can be a runner team or organisation. + * Can be a runner team or organization. */ @IsNotEmpty() @ManyToOne(() => RunnerGroup, group => group.runners) diff --git a/src/models/entities/RunnerOrganisation.ts b/src/models/entities/RunnerOrganisation.ts index e137cdf..719fb45 100644 --- a/src/models/entities/RunnerOrganisation.ts +++ b/src/models/entities/RunnerOrganisation.ts @@ -14,21 +14,21 @@ import { RunnerTeam } from "./RunnerTeam"; export class RunnerOrganisation extends RunnerGroup { /** - * The organisations's address. + * The organizations's address. */ @IsOptional() @Column(type => Address) address?: Address; /** - * The organisation's teams. - * Used to link teams to a organisation. + * The organization's teams. + * Used to link teams to a organization. */ @OneToMany(() => RunnerTeam, team => team.parentGroup, { nullable: true }) teams: RunnerTeam[]; /** - * The organisation's api key for self-service registration. + * The organization's api key for self-service registration. * The api key can be used for the /runners/register/:token endpoint. * Is has to be base64 encoded if used via the api (to keep url-safety). */ @@ -38,7 +38,7 @@ export class RunnerOrganisation extends RunnerGroup { key?: string; /** - * Returns all runners associated with this organisation (directly or indirectly via teams). + * Returns all runners associated with this organization (directly or indirectly via teams). */ public get allRunners(): Runner[] { let returnRunners: Runner[] = new Array(); diff --git a/src/models/responses/ResponseRunnerOrganisation.ts b/src/models/responses/ResponseRunnerOrganisation.ts index 40c3c57..af6fb4c 100644 --- a/src/models/responses/ResponseRunnerOrganisation.ts +++ b/src/models/responses/ResponseRunnerOrganisation.ts @@ -33,7 +33,7 @@ export class ResponseRunnerOrganisation extends ResponseRunnerGroup { teams: RunnerTeam[]; /** - * The organisation's registration key. + * The organization's registration key. * If registration is disabled this is null. */ @IsString() @@ -42,7 +42,7 @@ export class ResponseRunnerOrganisation extends ResponseRunnerGroup { registrationKey?: string; /** - * Is registration enabled for the organisation? + * Is registration enabled for the organization? */ @IsOptional() @IsBoolean() diff --git a/src/models/responses/ResponseRunnerTeam.ts b/src/models/responses/ResponseRunnerTeam.ts index 684005e..3d75cc3 100644 --- a/src/models/responses/ResponseRunnerTeam.ts +++ b/src/models/responses/ResponseRunnerTeam.ts @@ -9,7 +9,7 @@ import { ResponseRunnerOrganisation } from './ResponseRunnerOrganisation'; export class ResponseRunnerTeam extends ResponseRunnerGroup { /** - * The runnerTeam's parent group (organisation). + * The runnerTeam's parent group (organization). */ @IsObject() @IsNotEmpty() diff --git a/src/models/responses/ResponseStats.ts b/src/models/responses/ResponseStats.ts index a691306..84a0773 100644 --- a/src/models/responses/ResponseStats.ts +++ b/src/models/responses/ResponseStats.ts @@ -26,7 +26,7 @@ export class ResponseStats { total_teams: number; /** - * The amount of organisations registered in the system. + * The amount of organizations registered in the system. */ @IsInt() total_orgs: number; diff --git a/src/models/responses/ResponseStatsOrganisation.ts b/src/models/responses/ResponseStatsOrganisation.ts index 338a8b3..e235718 100644 --- a/src/models/responses/ResponseStatsOrganisation.ts +++ b/src/models/responses/ResponseStatsOrganisation.ts @@ -35,8 +35,8 @@ export class ResponseStatsOrgnisation { donationAmount: number; /** - * Creates a new organisation stats response from a organisation - * @param org The organisation whoes response shall be generated - the following relations have to be resolved: runners, runners.scans, runners.distanceDonations, runners.scans.track, teams, teams.runners, teams.runners.scans, teams.runners.distanceDonations, teams.runners.scans.track + * Creates a new organization stats response from a organization + * @param org The organization whoes response shall be generated - the following relations have to be resolved: runners, runners.scans, runners.distanceDonations, runners.scans.track, teams, teams.runners, teams.runners.scans, teams.runners.distanceDonations, teams.runners.scans.track */ public constructor(org: RunnerOrganisation) { this.name = org.name; diff --git a/src/tests/cards/cards_add.spec.ts b/src/tests/cards/cards_add.spec.ts index c89e55b..244ba12 100644 --- a/src/tests/cards/cards_add.spec.ts +++ b/src/tests/cards/cards_add.spec.ts @@ -69,7 +69,7 @@ describe('POST /api/cards successfully (with runner)', () => { let added_org; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/cards/cards_update.spec.ts b/src/tests/cards/cards_update.spec.ts index 4ef31ee..804428c 100644 --- a/src/tests/cards/cards_update.spec.ts +++ b/src/tests/cards/cards_update.spec.ts @@ -50,7 +50,7 @@ describe('adding + updating card.runner successfully', () => { let added_runner2; let added_card; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/contacts/contact_add.spec.ts b/src/tests/contacts/contact_add.spec.ts index f17233f..7508e05 100644 --- a/src/tests/contacts/contact_add.spec.ts +++ b/src/tests/contacts/contact_add.spec.ts @@ -108,7 +108,7 @@ describe('POST /api/contacts working (with group)', () => { let added_team; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; diff --git a/src/tests/contacts/contact_delete.spec.ts b/src/tests/contacts/contact_delete.spec.ts index f8d8c64..9ce8ab8 100644 --- a/src/tests/contacts/contact_delete.spec.ts +++ b/src/tests/contacts/contact_delete.spec.ts @@ -50,7 +50,7 @@ describe('add+delete (with org)', () => { let added_org; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; @@ -88,7 +88,7 @@ describe('add+delete (with team)', () => { let added_team; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; @@ -137,7 +137,7 @@ describe('add+delete (with org&team)', () => { let added_team; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; diff --git a/src/tests/contacts/contact_update.spec.ts b/src/tests/contacts/contact_update.spec.ts index 89af1b3..3132cbc 100644 --- a/src/tests/contacts/contact_update.spec.ts +++ b/src/tests/contacts/contact_update.spec.ts @@ -59,7 +59,7 @@ describe('Update contact group after adding (should work)', () => { let added_team; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; @@ -189,7 +189,7 @@ describe('Update contact group invalid after adding (should fail)', () => { let added_org; let added_contact; it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res.data.contact; diff --git a/src/tests/donations/donations_add.spec.ts b/src/tests/donations/donations_add.spec.ts index 523b767..e463c13 100644 --- a/src/tests/donations/donations_add.spec.ts +++ b/src/tests/donations/donations_add.spec.ts @@ -83,7 +83,7 @@ describe('POST /api/donations/distance illegally', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -199,7 +199,7 @@ describe('POST /api/donations/distance successfully', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/donations/donations_delete.spec.ts b/src/tests/donations/donations_delete.spec.ts index c238836..3296bf6 100644 --- a/src/tests/donations/donations_delete.spec.ts +++ b/src/tests/donations/donations_delete.spec.ts @@ -70,7 +70,7 @@ describe('DELETE distance donation', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/donations/donations_get.spec.ts b/src/tests/donations/donations_get.spec.ts index 8dd1a0f..9ce448f 100644 --- a/src/tests/donations/donations_get.spec.ts +++ b/src/tests/donations/donations_get.spec.ts @@ -73,7 +73,7 @@ describe('adding + getting distance donation', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/donations/donations_update.spec.ts b/src/tests/donations/donations_update.spec.ts index 2df6914..51bb46f 100644 --- a/src/tests/donations/donations_update.spec.ts +++ b/src/tests/donations/donations_update.spec.ts @@ -84,7 +84,7 @@ describe('adding + updating distance donation illegally', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -253,7 +253,7 @@ describe('adding + updating distance donation valid', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/donors/donor_delete.spec.ts b/src/tests/donors/donor_delete.spec.ts index 344dc20..a32c41c 100644 --- a/src/tests/donors/donor_delete.spec.ts +++ b/src/tests/donors/donor_delete.spec.ts @@ -60,7 +60,7 @@ describe('DELETE donor with donations invalid', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -115,7 +115,7 @@ describe('DELETE donor with donations valid', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/runnerOrgs/org_add.spec.ts b/src/tests/runnerOrgs/org_add.spec.ts index 4a376a8..30eb5f8 100644 --- a/src/tests/runnerOrgs/org_add.spec.ts +++ b/src/tests/runnerOrgs/org_add.spec.ts @@ -14,24 +14,24 @@ beforeAll(async () => { }; }); -describe('GET /api/organisations', () => { +describe('GET /api/organizations', () => { it('basic get should return 200', async () => { - const res = await axios.get(base + '/api/organisations', axios_config); + const res = await axios.get(base + '/api/organizations', axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); }); // --------------- -describe('POST /api/organisations', () => { +describe('POST /api/organizations', () => { it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with without a name should return 400', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": null }, axios_config); expect(res.status).toEqual(400); @@ -41,14 +41,14 @@ describe('POST /api/organisations', () => { // --------------- describe('adding + getting from all orgs', () => { it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); it('check if org was added', async () => { - const res = await axios.get(base + '/api/organisations', axios_config); + const res = await axios.get(base + '/api/organizations', axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") let added_org = res.data[res.data.length - 1] @@ -72,7 +72,7 @@ describe('adding + getting from all orgs', () => { describe('adding + getting explicitly', () => { let added_org_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data @@ -81,7 +81,7 @@ describe('adding + getting explicitly', () => { expect(res1.headers['content-type']).toContain("application/json") }); it('check if org was added', async () => { - const res2 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config); + const res2 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config); expect(res2.status).toEqual(200); expect(res2.headers['content-type']).toContain("application/json") let added_org2 = res2.data diff --git a/src/tests/runnerOrgs/org_delete.spec.ts b/src/tests/runnerOrgs/org_delete.spec.ts index b16c52d..dd190fb 100644 --- a/src/tests/runnerOrgs/org_delete.spec.ts +++ b/src/tests/runnerOrgs/org_delete.spec.ts @@ -17,7 +17,7 @@ beforeAll(async () => { // --------------- describe('adding + deletion (non-existant)', () => { it('delete', async () => { - const res2 = await axios.delete(base + '/api/organisations/0', axios_config); + const res2 = await axios.delete(base + '/api/organizations/0', axios_config); expect(res2.status).toEqual(204); }); }); @@ -26,7 +26,7 @@ describe('adding + deletion (successfull)', () => { let added_org_id let added_org it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -35,7 +35,7 @@ describe('adding + deletion (successfull)', () => { expect(res1.headers['content-type']).toContain("application/json") }); it('delete', async () => { - const res2 = await axios.delete(base + '/api/organisations/' + added_org_id, axios_config); + const res2 = await axios.delete(base + '/api/organizations/' + added_org_id, axios_config); expect(res2.status).toEqual(200); expect(res2.headers['content-type']).toContain("application/json") let added_org2 = res2.data @@ -56,7 +56,7 @@ describe('adding + deletion (successfull)', () => { }); }); it('check if org really was deleted', async () => { - const res3 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config); + const res3 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config); expect(res3.status).toEqual(404); expect(res3.headers['content-type']).toContain("application/json") }); @@ -68,7 +68,7 @@ describe('adding + deletion with teams still existing (without force)', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; @@ -87,7 +87,7 @@ describe('adding + deletion with teams still existing (without force)', () => { expect(res2.headers['content-type']).toContain("application/json") }); it('delete org - this should fail with a 406', async () => { - const res2 = await axios.delete(base + '/api/organisations/' + added_org_id, axios_config); + const res2 = await axios.delete(base + '/api/organizations/' + added_org_id, axios_config); expect(res2.status).toEqual(406); expect(res2.headers['content-type']).toContain("application/json") }); @@ -99,7 +99,7 @@ describe('adding + deletion with teams still existing (with force)', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; @@ -118,7 +118,7 @@ describe('adding + deletion with teams still existing (with force)', () => { expect(res2.headers['content-type']).toContain("application/json") }); it('delete', async () => { - const res2 = await axios.delete(base + '/api/organisations/' + added_org_id + '?force=true', axios_config); + const res2 = await axios.delete(base + '/api/organizations/' + added_org_id + '?force=true', axios_config); expect(res2.status).toEqual(200); expect(res2.headers['content-type']).toContain("application/json") let added_org2 = res2.data @@ -139,7 +139,7 @@ describe('adding + deletion with teams still existing (with force)', () => { }); }); it('check if org really was deleted', async () => { - const res3 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config); + const res3 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config); expect(res3.status).toEqual(404); expect(res3.headers['content-type']).toContain("application/json") }); diff --git a/src/tests/runnerOrgs/org_get.spec.ts b/src/tests/runnerOrgs/org_get.spec.ts index 5e17f19..b770c45 100644 --- a/src/tests/runnerOrgs/org_get.spec.ts +++ b/src/tests/runnerOrgs/org_get.spec.ts @@ -14,15 +14,15 @@ beforeAll(async () => { }; }); -describe('GET /api/organisations', () => { +describe('GET /api/organizations', () => { it('basic get should return 200', async () => { - const res = await axios.get(base + '/api/organisations', axios_config); + const res = await axios.get(base + '/api/organizations', axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); }); // --------------- -describe('GET /api/organisations/0', () => { +describe('GET /api/organizations/0', () => { it('basic get should return 404', async () => { const res = await axios.get(base + '/api/runners/0', axios_config); expect(res.status).toEqual(404); diff --git a/src/tests/runnerOrgs/org_update.spec.ts b/src/tests/runnerOrgs/org_update.spec.ts index 254fd87..6e33766 100644 --- a/src/tests/runnerOrgs/org_update.spec.ts +++ b/src/tests/runnerOrgs/org_update.spec.ts @@ -19,7 +19,7 @@ describe('adding + updating name', () => { let added_org_id let added_org it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -28,7 +28,7 @@ describe('adding + updating name', () => { expect(res.headers['content-type']).toContain("application/json") }); it('update org', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -59,7 +59,7 @@ describe('adding + try updating id (should return 406)', () => { let added_org_id let added_org it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -68,7 +68,7 @@ describe('adding + try updating id (should return 406)', () => { expect(res.headers['content-type']).toContain("application/json") }); it('update org', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id + 1, "name": "testlelele", "contact": null, @@ -83,7 +83,7 @@ describe('adding + updateing address valid)', () => { let added_org_id let added_org it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -92,7 +92,7 @@ describe('adding + updateing address valid)', () => { expect(res.headers['content-type']).toContain("application/json") }); it('adding address to org should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -122,7 +122,7 @@ describe('adding + updateing address valid)', () => { }); }); it('updateing address\'s first line should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -152,7 +152,7 @@ describe('adding + updateing address valid)', () => { }); }); it('updateing address\'s second line should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -182,7 +182,7 @@ describe('adding + updateing address valid)', () => { }); }); it('updateing address\'s city should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -212,7 +212,7 @@ describe('adding + updateing address valid)', () => { }); }); it('updateing address\'s country should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -242,7 +242,7 @@ describe('adding + updateing address valid)', () => { }); }); it('updateing address\'s postal code should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -272,7 +272,7 @@ describe('adding + updateing address valid)', () => { }); }); it('removing org\'s address should return 200', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -300,7 +300,7 @@ describe('adding + updateing address invalid)', () => { let added_org_id let added_org it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -309,7 +309,7 @@ describe('adding + updateing address invalid)', () => { expect(res.headers['content-type']).toContain("application/json") }); it('adding address to org w/o address1 should return 400', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -325,7 +325,7 @@ describe('adding + updateing address invalid)', () => { expect(res.headers['content-type']).toContain("application/json"); }); it('adding address to org w/o city should return 400', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -341,7 +341,7 @@ describe('adding + updateing address invalid)', () => { expect(res.headers['content-type']).toContain("application/json"); }); it('adding address to org w/o country should return 400', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -357,7 +357,7 @@ describe('adding + updateing address invalid)', () => { expect(res.headers['content-type']).toContain("application/json"); }); it('adding address to org w/o postal code should return 400', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, @@ -373,7 +373,7 @@ describe('adding + updateing address invalid)', () => { expect(res.headers['content-type']).toContain("application/json"); }); it('adding address to org w/ invalid postal code should return 400', async () => { - const res = await axios.put(base + '/api/organisations/' + added_org_id, { + const res = await axios.put(base + '/api/organizations/' + added_org_id, { "id": added_org_id, "name": "testlelele", "contact": null, diff --git a/src/tests/runnerTeams/team_add.spec.ts b/src/tests/runnerTeams/team_add.spec.ts index 588276a..8b7c9ce 100644 --- a/src/tests/runnerTeams/team_add.spec.ts +++ b/src/tests/runnerTeams/team_add.spec.ts @@ -58,7 +58,7 @@ describe('POST /api/teams with errors', () => { describe('POST /api/teams working', () => { let added_org_id; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data diff --git a/src/tests/runnerTeams/team_delete.spec.ts b/src/tests/runnerTeams/team_delete.spec.ts index 2f4270d..b379d76 100644 --- a/src/tests/runnerTeams/team_delete.spec.ts +++ b/src/tests/runnerTeams/team_delete.spec.ts @@ -21,7 +21,7 @@ describe('adding org', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; diff --git a/src/tests/runnerTeams/team_update.spec.ts b/src/tests/runnerTeams/team_update.spec.ts index 9f7007d..be1b1be 100644 --- a/src/tests/runnerTeams/team_update.spec.ts +++ b/src/tests/runnerTeams/team_update.spec.ts @@ -20,7 +20,7 @@ describe('adding + updating name', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; @@ -59,7 +59,7 @@ describe('adding + try updating id (should return 406)', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; @@ -92,7 +92,7 @@ describe('add+update parent org (valid)', () => { let added_team; let added_team_id it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data; @@ -110,7 +110,7 @@ describe('add+update parent org (valid)', () => { expect(res2.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res3 = await axios.post(base + '/api/organisations', { + const res3 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org2 = res3.data; diff --git a/src/tests/runners/runner_add.spec.ts b/src/tests/runners/runner_add.spec.ts index 44e2354..86083d6 100644 --- a/src/tests/runners/runner_add.spec.ts +++ b/src/tests/runners/runner_add.spec.ts @@ -80,7 +80,7 @@ describe('POST /api/runners with errors', () => { describe('POST /api/runners working', () => { let added_org_id; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data diff --git a/src/tests/runners/runner_delete.spec.ts b/src/tests/runners/runner_delete.spec.ts index de96333..bd9e224 100644 --- a/src/tests/runners/runner_delete.spec.ts +++ b/src/tests/runners/runner_delete.spec.ts @@ -25,7 +25,7 @@ describe('add+delete', () => { let added_org_id; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data @@ -71,7 +71,7 @@ describe('DELETE donor with donations invalid', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data @@ -118,7 +118,7 @@ describe('DELETE donor with donations valid', () => { expect(res.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res.data diff --git a/src/tests/runners/runner_get.spec.ts b/src/tests/runners/runner_get.spec.ts index 963512a..7cc1a79 100644 --- a/src/tests/runners/runner_get.spec.ts +++ b/src/tests/runners/runner_get.spec.ts @@ -33,7 +33,7 @@ describe('GET /api/runners after adding', () => { let added_org_id; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data diff --git a/src/tests/runners/runner_update.spec.ts b/src/tests/runners/runner_update.spec.ts index 81f80ac..8f8b5cf 100644 --- a/src/tests/runners/runner_update.spec.ts +++ b/src/tests/runners/runner_update.spec.ts @@ -18,7 +18,7 @@ describe('Update runner name after adding', () => { let added_org; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); delete res1.data.registrationEnabled; @@ -58,7 +58,7 @@ describe('Update runner group after adding', () => { let added_org_2; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data @@ -77,7 +77,7 @@ describe('Update runner group after adding', () => { expect(res2.headers['content-type']).toContain("application/json") }); it('creating a new org with just a name should return 200', async () => { - const res3 = await axios.post(base + '/api/organisations', { + const res3 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org_2 = res3.data @@ -103,7 +103,7 @@ describe('Update runner id after adding(should fail)', () => { let added_runner; let added_runner_id; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); let added_org = res1.data @@ -135,7 +135,7 @@ describe('Update runner group with invalid group after adding', () => { let added_org; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/scans/scans_add.spec.ts b/src/tests/scans/scans_add.spec.ts index 580ecd8..8a28e26 100644 --- a/src/tests/scans/scans_add.spec.ts +++ b/src/tests/scans/scans_add.spec.ts @@ -19,7 +19,7 @@ describe('POST /api/scans illegally', () => { let added_org; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -70,7 +70,7 @@ describe('POST /api/scans successfully', () => { let added_org; let added_runner; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -144,7 +144,7 @@ describe('POST /api/scans successfully via scan station', () => { let added_track; let added_station; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/scans/scans_delete.spec.ts b/src/tests/scans/scans_delete.spec.ts index 0ff0b72..02e7519 100644 --- a/src/tests/scans/scans_delete.spec.ts +++ b/src/tests/scans/scans_delete.spec.ts @@ -21,7 +21,7 @@ describe('DELETE scan', () => { let added_runner; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/scans/scans_get.spec.ts b/src/tests/scans/scans_get.spec.ts index a4128b7..e6a08a9 100644 --- a/src/tests/scans/scans_get.spec.ts +++ b/src/tests/scans/scans_get.spec.ts @@ -35,7 +35,7 @@ describe('adding + getting scans', () => { let added_runner; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/scans/scans_update.spec.ts b/src/tests/scans/scans_update.spec.ts index 60b7fb1..b261ee8 100644 --- a/src/tests/scans/scans_update.spec.ts +++ b/src/tests/scans/scans_update.spec.ts @@ -19,7 +19,7 @@ describe('adding + updating illegally', () => { let added_runner; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -86,7 +86,7 @@ describe('adding + updating successfilly', () => { let added_runner2; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/selfservice/selfservice_register.spec.ts b/src/tests/selfservice/selfservice_register.spec.ts index c1b9241..9409a96 100644 --- a/src/tests/selfservice/selfservice_register.spec.ts +++ b/src/tests/selfservice/selfservice_register.spec.ts @@ -98,7 +98,7 @@ describe('register citizen valid', () => { describe('register invalid company', () => { let added_org; it('creating a new org with just a name and registration enabled should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123", "registrationEnabled": true }, axios_config); @@ -156,7 +156,7 @@ describe('register valid company', () => { let added_org; let added_team; it('creating a new org with just a name and registration enabled should return 200', async () => { - const res = await axios.post(base + '/api/organisations', { + const res = await axios.post(base + '/api/organizations', { "name": "test123", "registrationEnabled": true }, axios_config); diff --git a/src/tests/trackscans/trackscans_add.spec.ts b/src/tests/trackscans/trackscans_add.spec.ts index a4b475d..a79011c 100644 --- a/src/tests/trackscans/trackscans_add.spec.ts +++ b/src/tests/trackscans/trackscans_add.spec.ts @@ -22,7 +22,7 @@ describe('POST /api/scans illegally', () => { let added_track; let added_station; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -109,7 +109,7 @@ describe('POST /api/scans successfully', () => { let added_track; let added_station; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -179,7 +179,7 @@ describe('POST /api/scans successfully via scan station', () => { let added_track; let added_station; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/trackscans/trackscans_delete.spec.ts b/src/tests/trackscans/trackscans_delete.spec.ts index 646c189..446ca84 100644 --- a/src/tests/trackscans/trackscans_delete.spec.ts +++ b/src/tests/trackscans/trackscans_delete.spec.ts @@ -24,7 +24,7 @@ describe('DELETE scan', () => { let added_station; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/trackscans/trackscans_get.spec.ts b/src/tests/trackscans/trackscans_get.spec.ts index 1f0eaed..d354f88 100644 --- a/src/tests/trackscans/trackscans_get.spec.ts +++ b/src/tests/trackscans/trackscans_get.spec.ts @@ -38,7 +38,7 @@ describe('adding + getting scans', () => { let added_station; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data diff --git a/src/tests/trackscans/trackscans_update.spec.ts b/src/tests/trackscans/trackscans_update.spec.ts index 131f3b4..071f7a2 100644 --- a/src/tests/trackscans/trackscans_update.spec.ts +++ b/src/tests/trackscans/trackscans_update.spec.ts @@ -22,7 +22,7 @@ describe('adding + updating illegally', () => { let added_station; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data @@ -123,7 +123,7 @@ describe('adding + updating successfilly', () => { let added_station2; let added_scan; it('creating a new org with just a name should return 200', async () => { - const res1 = await axios.post(base + '/api/organisations', { + const res1 = await axios.post(base + '/api/organizations', { "name": "test123" }, axios_config); added_org = res1.data