Skip to content

Commit 1126cf6

Browse files
authored
Fix org names (#19)
* add comms * add tests
1 parent 744c91a commit 1126cf6

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

src/orgs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ export const SIGList = [
1616
"SIGPolicy",
1717
"SIGARCH",
1818
"SIGRobotics",
19+
"SIGtricity",
1920
] as const;
2021

2122
export const CommitteeList = [
2223
"Infrastructure Committee",
2324
"Social Committee",
2425
"Mentorship Committee",
25-
"Academic Committee"
26+
"Academic Committee",
27+
"Corporate Committee",
28+
"Marketing Committee",
2629
] as const;
2730
export const OrganizationList = ["ACM", ...SIGList, ...CommitteeList];

tests/live/organizations.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { expect, test } from "vitest";
2+
import { InternalServerError } from "../../src/errors/index.js";
3+
4+
const appKey = process.env.APPLICATION_KEY;
5+
if (!appKey) {
6+
throw new InternalServerError({ message: "No application key found" });
7+
}
8+
9+
const baseEndpoint = `https://${appKey}.aws.qa.acmuiuc.org`;
10+
11+
test("getting organizations", async () => {
12+
const response = await fetch(`${baseEndpoint}/api/v1/organizations`);
13+
expect(response.status).toBe(200);
14+
const responseJson = (await response.json()) as string[];
15+
expect(responseJson.length).greaterThan(0);
16+
expect(responseJson).toContain("ACM");
17+
expect(responseJson).toContain("Infrastructure Committee");
18+
});

tests/unit/organizations.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { afterAll, expect, test } from "vitest";
2+
import init from "../../src/index.js";
3+
4+
const app = await init();
5+
test("Test getting the list of organizations succeeds", async () => {
6+
const response = await app.inject({
7+
method: "GET",
8+
url: "/api/v1/organizations",
9+
});
10+
expect(response.statusCode).toBe(200);
11+
const responseDataJson = await response.json();
12+
});
13+
afterAll(async () => {
14+
await app.close();
15+
});

0 commit comments

Comments
 (0)