@@ -31,7 +31,7 @@ afterAll((done) => {
3131
3232describe ( "Student API" , ( ) => {
3333 it ( "should create student" , async ( ) => {
34- const response = await agent . post ( "/student/add " ) . send ( {
34+ const response = await agent . post ( "/student/create " ) . send ( {
3535 ERPID : "S1032220999" ,
3636 name : "Arya" ,
3737 joiningYear : 2020 ,
@@ -42,13 +42,13 @@ describe("Student API", () => {
4242 } ) ;
4343
4444 expect ( response . status ) . toBe ( 200 ) ;
45- expect ( response . body . res ) . toMatch ( / a d d e d s t u d e n t / ) ;
45+ expect ( response . body . res ) . toMatch ( / a d d e d u s e r / ) ;
4646 } ) ;
4747
4848 describe ( "after adding student" , ( ) => {
4949 let id ;
5050 beforeEach ( async ( ) => {
51- id = await agent . post ( "/student/add " ) . send ( {
51+ id = await agent . post ( "/student/create " ) . send ( {
5252 ERPID : "S1032220999" ,
5353 name : "Arya" ,
5454 joiningYear : 2020 ,
@@ -83,10 +83,10 @@ describe("Student API", () => {
8383 it ( "should update student" , async ( ) => {
8484 const response = await agent
8585 . post ( `/student/update/${ id } ` )
86- . send ( { joiningYear : 2020 } ) ;
86+ . send ( { ERPID : "S1032220999" } , { joiningYear : 2021 } ) ;
8787
8888 expect ( response . status ) . toBe ( 200 ) ;
89- expect ( response . body . res ) . toMatch ( / u p d a t e d s t u d e n t / ) ;
89+ expect ( response . body . res ) . toMatch ( ` updated Student with id ${ id } ` ) ;
9090 } ) ;
9191 } ) ;
9292} ) ;
0 commit comments