@@ -2,22 +2,27 @@ describe('Test that weblinks API endpoint', () => {
22 afterEach ( ( ) => cy . task ( 'queryDB' , 'DELETE FROM #__weblinks WHERE title LIKE "%automated test weblink%"' ) ) ;
33
44 it ( 'can deliver a list of weblinks' , ( ) => {
5+ cy . db_enableExtension ( '1' , 'plg_webservices_weblinks' ) ;
56 cy . db_createWeblink ( { title : 'automated test weblink' } )
67 . then ( ( ) => cy . api_get ( '/weblinks' ) )
78 . then ( ( response ) => cy . wrap ( response ) . its ( 'body' ) . its ( 'data.0' ) . its ( 'attributes' )
89 . its ( 'title' )
910 . should ( 'include' , 'automated test weblink' ) ) ;
11+ cy . db_enableExtension ( '0' , 'plg_webservices_weblinks' ) ;
1012 } ) ;
1113
1214 it ( 'can deliver a single weblink' , ( ) => {
15+ cy . db_enableExtension ( '1' , 'plg_webservices_weblinks' ) ;
1316 cy . db_createWeblink ( { title : 'automated test weblink' } )
1417 . then ( ( weblink ) => cy . api_get ( `/weblinks/${ weblink . id } ` ) )
1518 . then ( ( response ) => cy . wrap ( response ) . its ( 'body' ) . its ( 'data' ) . its ( 'attributes' )
1619 . its ( 'title' )
1720 . should ( 'include' , 'automated test weblink' ) ) ;
21+ cy . db_enableExtension ( '0' , 'plg_webservices_weblinks' ) ;
1822 } ) ;
1923
2024 it ( 'can create a weblink' , ( ) => {
25+ cy . db_enableExtension ( '1' , 'plg_webservices_weblinks' ) ;
2126 cy . db_createCategory ( { extension : 'com_weblinks' } )
2227 . then ( ( categoryId ) => cy . api_post ( '/weblinks' , {
2328 title : 'automated test weblink' ,
@@ -31,18 +36,24 @@ describe('Test that weblinks API endpoint', () => {
3136 . then ( ( response ) => cy . wrap ( response ) . its ( 'body' ) . its ( 'data' ) . its ( 'attributes' )
3237 . its ( 'title' )
3338 . should ( 'include' , 'automated test weblink' ) ) ;
39+ cy . db_enableExtension ( '0' , 'plg_webservices_weblinks' ) ;
3440 } ) ;
3541
3642 it ( 'can update a weblink' , ( ) => {
43+ cy . db_enableExtension ( '1' , 'plg_webservices_weblinks' ) ;
3744 cy . db_createWeblink ( { title : 'automated test weblink' } )
3845 . then ( ( weblink ) => cy . api_patch ( `/weblinks/${ weblink . id } ` , { title : 'updated automated test weblink' } ) )
3946 . then ( ( response ) => cy . wrap ( response ) . its ( 'body' ) . its ( 'data' ) . its ( 'attributes' )
4047 . its ( 'title' )
4148 . should ( 'include' , 'updated automated test weblink' ) ) ;
49+ cy . db_enableExtension ( '0' , 'plg_webservices_weblinks' ) ;
4250 } ) ;
4351
4452 it ( 'can delete a weblink' , ( ) => {
53+ cy . db_enableExtension ( '1' , 'plg_webservices_weblinks' ) ;
4554 cy . db_createWeblink ( { title : 'automated test weblink' , state : - 2 } )
46- . then ( ( weblink ) => cy . api_delete ( `/weblinks/${ weblink . id } ` ) ) ;
55+ . then ( ( weblink ) => cy . api_delete ( `/weblinks/${ weblink . id } ` ) )
56+ . then ( ( response ) => cy . wrap ( response ) . its ( 'status' ) . should ( 'eq' , 204 ) ) ;
57+ cy . db_enableExtension ( '0' , 'plg_webservices_weblinks' ) ;
4758 } ) ;
4859} ) ;
0 commit comments