You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f14876d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: features/block-search.feature
+77-15Lines changed: 77 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,11 @@ Feature: Search posts by block usage
5
5
Given a WP install
6
6
7
7
Scenario: Search posts by block type usage
8
-
When I run `wp post --post_type=post create --post_title='Quote Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello world</p></blockquote><!-- /wp:quote -->' --porcelain`
When I run `wp post create quote-post.html --post_type=post --post_title='Quote Post' --post_status=publish --porcelain`
9
13
Then STDOUT should be a number
10
14
And save STDOUT as {QUOTE_POST_ID}
11
15
@@ -16,7 +20,11 @@ Feature: Search posts by block usage
16
20
"""
17
21
18
22
Scenario: Search posts by block namespace
19
-
When I run `wp post --post_type=post create --post_title='Core Namespace Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello core</p></blockquote><!-- /wp:quote -->' --porcelain`
When I run `wp post create rounded-image-post.html --post_type=post --post_title='Rounded Image Post' --post_status=publish --porcelain`
42
58
Then STDOUT should be a number
43
59
And save STDOUT as {ROUNDED_IMAGE_POST_ID}
44
60
45
-
When I run `wp post --post_type=post create --post_title='Plain Image Post' --post_status=publish --post_content='<!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image -->' --porcelain`
When I run `wp post create rounded-quote-post.html --post_type=post --post_title='Rounded Quote Post' --post_status=publish --porcelain`
49
73
Then STDOUT should be a number
50
74
And save STDOUT as {ROUNDED_QUOTE_POST_ID}
51
75
@@ -67,11 +91,19 @@ Feature: Search posts by block usage
67
91
"""
68
92
69
93
Scenario: Search block usage count
70
-
When I run `wp post --post_type=post create --post_title='Counted Quote One' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>One</p></blockquote><!-- /wp:quote -->' --porcelain`
When I run `wp post create counted-quote-one.html --post_type=post --post_title='Counted Quote One' --post_status=publish --porcelain`
71
99
Then STDOUT should be a number
72
100
And save STDOUT as {COUNTED_QUOTE_ONE_ID}
73
101
74
-
When I run `wp post --post_type=post create --post_title='Counted Quote Two' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Two</p></blockquote><!-- /wp:quote -->' --porcelain`
When I run `wp post create nested-pattern-image-post.html --post_type=post --post_title='Nested Pattern Image Post' --post_status=publish --porcelain`
151
203
Then STDOUT should be a number
152
204
And save STDOUT as {NESTED_PATTERN_IMAGE_POST_ID}
153
205
@@ -172,11 +224,21 @@ Feature: Search posts by block usage
172
224
Then STDOUT should be a number
173
225
And save STDOUT as {SYNCED_PATTERN_ID}
174
226
175
-
When I run `wp post --post_type=post create --post_title='Reusable Pattern Post' --post_status=publish --post_content='<!-- wp:block {"ref":{SYNCED_PATTERN_ID}} /-->' --porcelain`
227
+
When I run `wp post create --post_type=post --post_title='Reusable Pattern Post' --post_status=publish --porcelain`
176
228
Then STDOUT should be a number
177
229
And save STDOUT as {SYNCED_PATTERN_POST_ID}
178
230
179
-
When I run `wp post --post_type=post create --post_title='Different Reusable Pattern Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Not reusable</p></blockquote><!-- /wp:quote -->' --porcelain`
231
+
When I run `wp post block insert {SYNCED_PATTERN_POST_ID} core/block --attrs='{"ref":{SYNCED_PATTERN_ID}}'`
232
+
Then STDOUT should contain:
233
+
"""
234
+
Success: Inserted block into post {SYNCED_PATTERN_POST_ID}.
235
+
"""
236
+
237
+
Given a different-reusable-pattern-post.html file:
When I run `wp post create different-reusable-pattern-post.html --post_type=post --post_title='Different Reusable Pattern Post' --post_status=publish --porcelain`
180
242
Then STDOUT should be a number
181
243
182
244
When I run `wp block search --synced-pattern={SYNCED_PATTERN_ID} --field=ID`
0 commit comments