-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Including adding of category and retrieving pattern by category to th…
…e main flow (#54923)
- Loading branch information
1 parent
101306e
commit 3cc9af1
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/e2e-test-utils-playwright/src/request-utils/patterns.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { RequestUtils } from './index'; | ||
|
||
/** | ||
* Delete all pattern categories using REST API. | ||
* | ||
* @see https://developer.wordpress.org/rest-api/reference/categories/#list-categories | ||
* @param this | ||
*/ | ||
export async function deleteAllPatternCategories( this: RequestUtils ) { | ||
// List all pattern categories. | ||
// https://developer.wordpress.org/rest-api/reference/categories/#list-categories | ||
const categories = await this.rest( { | ||
path: '/wp/v2/wp_pattern_category', | ||
params: { | ||
per_page: 100, | ||
}, | ||
} ); | ||
|
||
// Delete pattern categories. | ||
// https://developer.wordpress.org/rest-api/reference/categories/#delete-a-category | ||
// "/wp/v2/category" does not yet supports batch requests. | ||
await this.batchRest( | ||
categories.map( ( category: { id: number } ) => ( { | ||
method: 'DELETE', | ||
path: `/wp/v2/wp_pattern_category/${ category.id }?force=true`, | ||
} ) ) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3cc9af1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 3cc9af1.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6375680651
📝 Reported issues:
/test/e2e/specs/editor/various/multi-block-selection.spec.js