Skip to content

Commit

Permalink
Harden check for post being set
Browse files Browse the repository at this point in the history
Co-authored-by: Piotr Delawski <[email protected]>
  • Loading branch information
westonruter and delawski authored Oct 21, 2021
1 parent 8376583 commit 284e489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/specs/admin/amp-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe( 'AMP settings screen Review panel', () => {
afterAll( async () => {
await visitAdminPage( 'admin.php', 'page=amp-options' );

if ( testPost.id ) {
if ( testPost?.id ) {
await page.evaluate( ( id ) => wp.apiFetch( {
path: `/wp/v2/posts/${ id }`,
method: 'DELETE',
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/specs/amp-onboarding/done.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ describe( 'Done', () => {
afterAll( async () => {
await visitAdminPage( 'admin.php', 'page=amp-options' );

if ( testPost.id ) {
if ( testPost?.id ) {
await page.evaluate( ( id ) => wp.apiFetch( {
path: `/wp/v2/posts/${ id }`,
method: 'DELETE',
data: { force: true },
} ), testPost.id );
}
if ( testPage.id ) {
if ( testPage?.id ) {
await page.evaluate( ( id ) => wp.apiFetch( {
path: `/wp/v2/pages/${ id }`,
method: 'DELETE',
Expand Down

0 comments on commit 284e489

Please sign in to comment.