Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Oct 19, 2023
1 parent 97b1e09 commit c734d75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class InteractivityUtils {
content: `<!-- wp:${ block } /-->`,
status: 'publish' as 'publish',
date_gmt: '2023-01-01T00:00:00',
title: alias,
};

const { link } = await this.requestUtils.createPost( payload );
Expand Down
17 changes: 17 additions & 0 deletions test/e2e/specs/interactivity/router-regions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,21 @@ test.describe( 'Router regions', () => {
await page.getByTestId( 'back' ).click();
await expect( nestedRegionSsr ).toHaveText( 'content from page 1' );
} );

test( 'Page title is updated', async ( { page } ) => {
expect( await page.title() ).toBe(
'router regions – page 1 – gutenberg'
);
await page.getByTestId( 'next' ).click();
await page.waitForFunction(
() => document.title === 'router regions – page 2 – gutenberg'
);
expect( await page.title() ).toBe(
'router regions – page 2 – gutenberg'
);
await page.getByTestId( 'back' ).click();
expect( await page.title() ).toBe(
'router regions – page 1 – gutenberg'
);
} );
} );

0 comments on commit c734d75

Please sign in to comment.