forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,020 additions
and
586 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
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
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
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
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
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
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
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
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
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
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
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
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
47 changes: 0 additions & 47 deletions
47
packages/e2e-test-utils-playwright/src/admin/create-new-post.js
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
packages/e2e-test-utils-playwright/src/admin/create-new-post.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,38 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { Admin } from './'; | ||
|
||
interface NewPostOptions { | ||
postType?: string; | ||
title?: string; | ||
content?: string; | ||
excerpt?: string; | ||
showWelcomeGuide?: boolean; | ||
} | ||
|
||
/** | ||
* Creates new post. | ||
* | ||
* @param this | ||
* @param options Options to create new post. | ||
*/ | ||
export async function createNewPost( | ||
this: Admin, | ||
options: NewPostOptions = {} | ||
) { | ||
const query = new URLSearchParams(); | ||
const { postType, title, content, excerpt } = options; | ||
|
||
if ( postType ) query.set( 'post_type', postType ); | ||
if ( title ) query.set( 'post_title', title ); | ||
if ( content ) query.set( 'content', content ); | ||
if ( excerpt ) query.set( 'excerpt', excerpt ); | ||
|
||
await this.visitAdminPage( 'post-new.php', query.toString() ); | ||
|
||
await this.editor.setPreferences( 'core/edit-post', { | ||
welcomeGuide: options.showWelcomeGuide ?? false, | ||
fullscreenMode: false, | ||
} ); | ||
} |
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,24 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { Admin } from '.'; | ||
|
||
/** | ||
* Open the post with given ID in the editor. | ||
* | ||
* @param this | ||
* @param postId Post ID to visit. | ||
*/ | ||
export async function editPost( this: Admin, postId: string | number ) { | ||
const query = new URLSearchParams(); | ||
|
||
query.set( 'post', String( postId ) ); | ||
query.set( 'action', 'edit' ); | ||
|
||
await this.visitAdminPage( 'post.php', query.toString() ); | ||
|
||
await this.editor.setPreferences( 'core/edit-post', { | ||
welcomeGuide: false, | ||
fullscreenMode: false, | ||
} ); | ||
} |
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
Oops, something went wrong.