Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix org names #19

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/orgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
18 changes: 18 additions & 0 deletions tests/live/organizations.test.ts
Original file line number Diff line number Diff line change
@@ -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");
});
15 changes: 15 additions & 0 deletions tests/unit/organizations.test.ts
Original file line number Diff line number Diff line change
@@ -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();

Check warning on line 11 in tests/unit/organizations.test.ts

View workflow job for this annotation

GitHub Actions / Run Unit Tests

'responseDataJson' is assigned a value but never used. Allowed unused vars must match /^_/u
});
afterAll(async () => {
await app.close();
});
Loading