File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ export const SIGList = [
1616 "SIGPolicy" ,
1717 "SIGARCH" ,
1818 "SIGRobotics" ,
19+ "SIGtricity" ,
1920] as const ;
2021
2122export 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 ;
2730export const OrganizationList = [ "ACM" , ...SIGList , ...CommitteeList ] ;
Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments