@@ -2,14 +2,12 @@ import { Selector, RequestLogger } from 'testcafe';
2
2
import { baseURL } from '../auth' ;
3
3
import { link } from '../utilities/page-model/helpers/field' ;
4
4
import AdvancedCheck from '../utilities/page-model/helpers/advanced-check' ;
5
- import Page from '../utilities/page-model/helpers/page' ;
6
5
// new Page model. Might be used soon as default
7
- import PagePostType from '../models/Page' ;
6
+ import Page from '../models/Page' ;
8
7
9
8
let shortcodeHolder ;
10
9
let downloadUrl ;
11
10
const run = new AdvancedCheck ( ) ;
12
- const page = new Page ( ) ;
13
11
const downloadLogger = RequestLogger ( downloadUrl , {
14
12
logResponseBody : true ,
15
13
logResponseHeaders : true ,
@@ -87,13 +85,14 @@ test( 'should check if the shortcode confirmation type PAGE is working correctly
87
85
88
86
// Create a new page and insert a shortcode block
89
87
const name = 'Shortcode confrimation type Page' ;
90
- const pagePostType = new PagePostType ( name ) ;
91
- await pagePostType . add ( ) ;
92
- await pagePostType . insertBlock ( 'shortcode' , {
88
+ const page = new Page ( name ) ;
89
+ await page . add ( ) ;
90
+ await page . insertBlock ( 'shortcode' , {
93
91
target : '.block-editor-plain-text' ,
94
92
content : shortcodeHolder ,
95
93
} ) ;
96
- await pagePostType . publishChanges ( ) ;
94
+ await page . saveChanges ( ) ;
95
+ await page . publishChanges ( ) ;
97
96
98
97
// update form settings
99
98
await run . navigateConfirmationSection (
@@ -150,6 +149,9 @@ test( 'should check if the shortcode confirmation type PAGE is working correctly
150
149
)
151
150
)
152
151
. ok ( ) ;
152
+
153
+ // Cleanup
154
+ await page . delete ( ) ;
153
155
} ) ;
154
156
155
157
test ( 'should check if the shortcode confirmation type REDIRECT download is working correctly' , async ( t ) => {
@@ -199,15 +201,3 @@ test( 'should check if the shortcode confirmation type REDIRECT download is work
199
201
)
200
202
. ok ( ) ;
201
203
} ) ;
202
-
203
- // TODO: make these scenarios as part of the isolated test cases
204
- // eslint-disable-next-line jest/no-commented-out-tests
205
- // test( 'reset/clean Page entry for the next test', async ( t ) => {
206
- // // Actions & Assertions
207
- // await page.navigatePage();
208
- // await t
209
- // .hover( link( '#the-list', 'Test-page' ) )
210
- // .click( page.trashLink )
211
- // .expect( link( '#the-list', 'Test-page' ).exists )
212
- // .notOk();
213
- // } );
0 commit comments