File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,15 @@ describe("checking tutorial functions", () => {
4545 expect ( response . body . res ) . toMatch ( / a d d e d t u t o r i a l / ) ;
4646 } ) ;
4747
48+ let tutorialId ;
4849 beforeEach ( async ( ) => {
49- agent . post ( "/tutorial/add" ) . send ( {
50+ const id = agent . post ( "/tutorial/add" ) . send ( {
5051 no : "123" ,
5152 title : "abc" ,
5253 hours : "3" ,
5354 cognitiveLevel : [ "L1" , "L2" ] ,
5455 } ) ;
56+ tutorialId = JSON . parse ( id . res . text ) . id ;
5557 } ) ;
5658
5759 afterEach ( async ( ) => {
@@ -68,7 +70,7 @@ describe("checking tutorial functions", () => {
6870
6971 it ( "update tutorial" , async ( ) => {
7072 const response = await agent
71- . post ( " /tutorial/update" )
73+ . post ( ` /tutorial/update+ ${ tutorialId } ` )
7274 . send ( { no : "123" } , { no : "123" } ) ;
7375 expect ( response . headers [ "content-type" ] ) . toMatch ( / j s o n / ) ;
7476 expect ( response . status ) . toBe ( 200 ) ;
You can’t perform that action at this time.
0 commit comments