@@ -10,7 +10,7 @@ import {
10
10
newAppliedPhysicsFacultyMember ,
11
11
bioengineeringFacultyMember ,
12
12
} from 'testData' ;
13
- import * as api from 'client/api' ;
13
+ import { FacultyAPI } from 'client/api' ;
14
14
import { ManageFacultyResponseDTO } from 'common/dto/faculty/ManageFacultyResponse.dto' ;
15
15
import {
16
16
strictEqual ,
@@ -44,7 +44,8 @@ describe('Faculty API', function () {
44
44
] ,
45
45
} ,
46
46
} ) ;
47
- const response = await api . getFacultySchedulesForYear ( acadYear ) ;
47
+ const response = await FacultyAPI
48
+ . getFacultySchedulesForYear ( acadYear ) ;
48
49
result = response [ acadYear ] [ 0 ] ;
49
50
} ) ;
50
51
it ( 'should call getAllFacultySchedules' , function ( ) {
@@ -64,7 +65,7 @@ describe('Faculty API', function () {
64
65
} ) ;
65
66
it ( 'should throw an error' , async function ( ) {
66
67
try {
67
- await api . getAllFacultyMembers ( ) ;
68
+ await FacultyAPI . getAllFacultyMembers ( ) ;
68
69
fail ( 'Did not throw an error' ) ;
69
70
} catch ( err ) {
70
71
strictEqual ( err , error ) ;
@@ -97,7 +98,7 @@ describe('Faculty Admin API', function () {
97
98
bioengineeringFacultyMemberResponse ,
98
99
] ,
99
100
} as AxiosResponse < ManageFacultyResponseDTO [ ] > ) ;
100
- getFacultyResult = await api . getAllFacultyMembers ( ) ;
101
+ getFacultyResult = await FacultyAPI . getAllFacultyMembers ( ) ;
101
102
} ) ;
102
103
it ( 'should call getAllFacultyMembers' , function ( ) {
103
104
strictEqual ( getStub . callCount , 1 ) ;
@@ -120,7 +121,7 @@ describe('Faculty Admin API', function () {
120
121
} ) ;
121
122
it ( 'should throw an error' , async function ( ) {
122
123
try {
123
- await api . getAllFacultyMembers ( ) ;
124
+ await FacultyAPI . getAllFacultyMembers ( ) ;
124
125
fail ( 'Did not throw an error' ) ;
125
126
} catch ( err ) {
126
127
deepStrictEqual ( err , error ) ;
@@ -141,7 +142,7 @@ describe('Faculty Admin API', function () {
141
142
postStub . resolves ( {
142
143
data : physicsFacultyMemberResponse ,
143
144
} as AxiosResponse < ManageFacultyResponseDTO > ) ;
144
- createFacultyResult = await api
145
+ createFacultyResult = await FacultyAPI
145
146
. createFaculty ( newAppliedPhysicsFacultyMember ) ;
146
147
} ) ;
147
148
it ( 'should call createFaculty' , function ( ) {
@@ -161,7 +162,7 @@ describe('Faculty Admin API', function () {
161
162
} ) ;
162
163
it ( 'should throw an error' , async function ( ) {
163
164
try {
164
- await api . createFaculty ( newAppliedPhysicsFacultyMember ) ;
165
+ await FacultyAPI . createFaculty ( newAppliedPhysicsFacultyMember ) ;
165
166
fail ( 'Did not throw an error' ) ;
166
167
} catch ( err ) {
167
168
deepStrictEqual ( err , error ) ;
@@ -190,7 +191,7 @@ describe('Faculty Admin API', function () {
190
191
putStub . resolves ( {
191
192
data : editedFacultyMemberResponse ,
192
193
} as AxiosResponse < ManageFacultyResponseDTO > ) ;
193
- editFacultyResult = await api
194
+ editFacultyResult = await FacultyAPI
194
195
. editFaculty ( editedFacultyMember ) ;
195
196
} ) ;
196
197
it ( 'should call editFaculty' , function ( ) {
@@ -213,7 +214,7 @@ describe('Faculty Admin API', function () {
213
214
} ) ;
214
215
it ( 'should throw an error' , async function ( ) {
215
216
try {
216
- await api . editFaculty ( bioengineeringFacultyMember ) ;
217
+ await FacultyAPI . editFaculty ( bioengineeringFacultyMember ) ;
217
218
fail ( 'Did not throw an error' ) ;
218
219
} catch ( err ) {
219
220
deepStrictEqual ( err , error ) ;
0 commit comments