@@ -31,7 +31,7 @@ describe( 'Query block', () => {
31
31
await trashAllPosts ( 'page' ) ;
32
32
} ) ;
33
33
describe ( 'Query block insertion' , ( ) => {
34
- it ( 'Carousel ' , async ( ) => {
34
+ it ( 'List ' , async ( ) => {
35
35
await insertBlock ( 'Query' ) ;
36
36
// Wait for the choose pattern button
37
37
const choosePatternButton = await page . waitForSelector (
@@ -40,64 +40,20 @@ describe( 'Query block', () => {
40
40
await choosePatternButton . click ( ) ;
41
41
// Wait for pattern blocks to be loaded.
42
42
await page . waitForSelector (
43
- '.block-editor-block-pattern-setup__container iframe[title="Editor canvas"]'
43
+ '.block-library-query-pattern__selection-content iframe[title="Editor canvas"]'
44
44
) ;
45
- /**
46
- * Ensure that carousel is working by checking slider css classes
47
- * and navigating to the next pattern.
48
- */
49
- await page . waitForSelector (
50
- 'li.pattern-slide.active-slide[aria-label="Query Test 1"]'
51
- ) ;
52
- const nextPatternButton = await page . waitForSelector (
53
- '.block-editor-block-pattern-setup__navigation button[aria-label="Next pattern"]'
54
- ) ;
55
- await nextPatternButton . click ( ) ;
56
- await page . waitForSelector (
57
- 'li.pattern-slide.active-slide[aria-label="Query Test 2"]'
45
+ // Choose the standard pattern.
46
+ const chosenPattern = await page . waitForSelector (
47
+ '.block-editor-block-patterns-list__item[aria-label="Standard"]'
58
48
) ;
59
- // Choose the selected pattern.
60
- const chooseButton = await page . waitForXPath (
61
- '//div[contains(@class, "block-editor-block-pattern-setup__actions")]//button[text()="Choose"]'
62
- ) ;
63
- chooseButton . click ( ) ;
49
+ chosenPattern . click ( ) ;
64
50
// Wait for pattern setup to go away.
65
- await page . waitForSelector ( '.block-editor-block-pattern-setup' , {
66
- hidden : true ,
67
- } ) ;
68
- /**
69
- * We can't use `getEditedPostContent` easily for now because
70
- * `query` makes used of `instanceId` so it's not very reliable.
71
- * This should be revisited.
72
- */
73
- await page . waitForSelector ( '.wp-block-post-date' ) ;
74
- await page . waitForSelector ( '.wp-block-post-title' ) ;
75
- } ) ;
76
- it ( 'Grid view' , async ( ) => {
77
- await insertBlock ( 'Query' ) ;
78
- // Wait for the choose pattern button
79
- const choosePatternButton = await page . waitForSelector (
80
- 'div[data-type="core/query"] button.is-primary'
81
- ) ;
82
- await choosePatternButton . click ( ) ;
83
- // Wait for patterns setup to be loaded.
84
51
await page . waitForSelector (
85
- '.block-editor-block-pattern-setup__display-controls'
52
+ '.block-library-query-pattern__selection-content' ,
53
+ {
54
+ hidden : true ,
55
+ }
86
56
) ;
87
- // Click the Grid view button.
88
- const gridViewButton = await page . waitForSelector (
89
- '.block-editor-block-pattern-setup__display-controls button[aria-label="Grid view"]'
90
- ) ;
91
- await gridViewButton . click ( ) ;
92
- // Wait for patterns to be loaded and click the wanted pattern.
93
- const gridPattern = await page . waitForSelector (
94
- '.block-editor-block-pattern-setup-list__list-item[aria-label="Query Test 2"]'
95
- ) ;
96
- await gridPattern . click ( ) ;
97
- // Wait for pattern setup to go away.
98
- await page . waitForSelector ( '.block-editor-block-pattern-setup' , {
99
- hidden : true ,
100
- } ) ;
101
57
/**
102
58
* We can't use `getEditedPostContent` easily for now because
103
59
* `query` makes used of `instanceId` so it's not very reliable.
0 commit comments