Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Add e2e test for 404 page #69272

Merged
merged 3 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/e2e/specs/site-editor/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,25 @@ test.describe( 'Site editor navigation', () => {
// We should have our editor canvas button back
await expect( editorCanvasButton ).toBeVisible();
} );

test( 'Should show 404 page when navigating to non-existent template', async ( {
admin,
page,
} ) => {
await admin.visitSiteEditor();

// Navigate to a non-existent template.
await page.goto( '/wp-admin/site-editor.php?p=%2Ftemplate-foo-bar' );

// Verify the 404 error notice is displayed with the correct message.
await expect(
page
.locator( '.components-notice__content' )
.getByText(
'The requested page could not be found. Please check the URL.'
)
).toBeVisible();
} );
} );

class EditorNavigationUtils {
Expand Down
Loading