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

Blueprints: Support a landingPage value without the initial slash #1227

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions packages/playground/remote/src/lib/boot-playground-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export async function bootPlaygroundRemote() {
});
},
async goTo(requestedPath: string) {
if (!requestedPath.startsWith('/')) {
requestedPath = '/' + requestedPath;
}
/**
* People often forget to type the trailing slash at the end of
* /wp-admin/ URL and end up with wrong relative hrefs. Let's
Expand Down
9 changes: 9 additions & 0 deletions packages/playground/website/cypress/e2e/blueprints.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ describe('Blueprints', () => {
cy.wordPressDocument().its('body').should('contain', 'Sample Page');
});

it('Landing page without the initial slash should work', () => {
const blueprint: Blueprint = {
landingPage: 'wp-admin/plugins.php',
login: true,
};
cy.visit('/#' + JSON.stringify(blueprint));
cy.wordPressDocument().its('body').should('contain.text', 'Plugins');
});

it('enableMultisite step should enable a multisite', () => {
const blueprint: Blueprint = {
landingPage: '/',
Expand Down
Loading