diff --git a/src/orgs.ts b/src/orgs.ts index 25142569..ba1091eb 100644 --- a/src/orgs.ts +++ b/src/orgs.ts @@ -16,12 +16,15 @@ export const SIGList = [ "SIGPolicy", "SIGARCH", "SIGRobotics", + "SIGtricity", ] as const; export const CommitteeList = [ "Infrastructure Committee", "Social Committee", "Mentorship Committee", - "Academic Committee" + "Academic Committee", + "Corporate Committee", + "Marketing Committee", ] as const; export const OrganizationList = ["ACM", ...SIGList, ...CommitteeList]; diff --git a/tests/live/organizations.test.ts b/tests/live/organizations.test.ts new file mode 100644 index 00000000..f82bbf70 --- /dev/null +++ b/tests/live/organizations.test.ts @@ -0,0 +1,18 @@ +import { expect, test } from "vitest"; +import { InternalServerError } from "../../src/errors/index.js"; + +const appKey = process.env.APPLICATION_KEY; +if (!appKey) { + throw new InternalServerError({ message: "No application key found" }); +} + +const baseEndpoint = `https://${appKey}.aws.qa.acmuiuc.org`; + +test("getting organizations", async () => { + const response = await fetch(`${baseEndpoint}/api/v1/organizations`); + expect(response.status).toBe(200); + const responseJson = (await response.json()) as string[]; + expect(responseJson.length).greaterThan(0); + expect(responseJson).toContain("ACM"); + expect(responseJson).toContain("Infrastructure Committee"); +}); diff --git a/tests/unit/organizations.test.ts b/tests/unit/organizations.test.ts new file mode 100644 index 00000000..78bbc985 --- /dev/null +++ b/tests/unit/organizations.test.ts @@ -0,0 +1,15 @@ +import { afterAll, expect, test } from "vitest"; +import init from "../../src/index.js"; + +const app = await init(); +test("Test getting the list of organizations succeeds", async () => { + const response = await app.inject({ + method: "GET", + url: "/api/v1/organizations", + }); + expect(response.statusCode).toBe(200); + const responseDataJson = await response.json(); +}); +afterAll(async () => { + await app.close(); +});