@@ -17,7 +17,7 @@ beforeAll((done) => {
1717} ) ;
1818
1919function cleanUp ( callback ) {
20- attendanceModel . remove ( { name : "xyz" } ) . then ( ( ) => {
20+ attendanceModel . remove ( { student : "xyz" } ) . then ( ( ) => {
2121 connector . disconnect ( ( DBerr ) => {
2222 if ( DBerr ) console . log ( "Database dissconnnect error: " , DBerr ) ;
2323 server . close ( ( serverErr ) => {
@@ -35,7 +35,7 @@ afterAll((done) => {
3535describe ( "checking attendance functions" , ( ) => {
3636 it ( "create attendance" , async ( ) => {
3737 const response = await agent . post ( "/attendance/add" ) . send ( {
38- name : "xyz" ,
38+ student : "xyz" ,
3939 course : "XYZ" ,
4040 monthlyAttended : 123 ,
4141 monthlyOccured : 123 ,
@@ -49,7 +49,7 @@ describe("checking attendance functions", () => {
4949 let id ;
5050 beforeEach ( async ( ) => {
5151 id = await agent . post ( "/attendance/add" ) . send ( {
52- name : "xyz" ,
52+ student : "xyz" ,
5353 course : "XYZ" ,
5454 monthlyAttended : 123 ,
5555 monthlyOccured : 123 ,
@@ -60,21 +60,21 @@ describe("checking attendance functions", () => {
6060 } ) ;
6161
6262 afterEach ( async ( ) => {
63- await attendanceModel . remove ( { name : "xyz" } ) ;
63+ await attendanceModel . remove ( { student : "xyz" } ) ;
6464 } ) ;
6565
6666 it ( "read attendance" , async ( ) => {
6767 const response = await agent
6868 . get ( "/attendance/list" )
69- . send ( { name : "xyz" } ) ;
69+ . send ( { student : "xyz" } ) ;
7070 expect ( response . status ) . toBe ( 200 ) ;
7171 expect ( response . body . res ) . toBeDefined ( ) ;
7272 } ) ;
7373
7474 it ( "update attendance" , async ( ) => {
7575 const response = await agent
7676 . post ( `/attendance/update/${ id } ` )
77- . send ( { name : "xyz" } , { name : "123" } ) ;
77+ . send ( { student : "xyz" } , { student : "123" } ) ;
7878 expect ( response . headers [ "content-type" ] ) . toMatch ( / j s o n / ) ;
7979 expect ( response . status ) . toBe ( 200 ) ;
8080 expect ( response . body . res ) . toMatch ( / a t t e n d a n c e u p d a t e d / ) ;
0 commit comments