Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Jan 18, 2024
1 parent ac0930d commit 84053ab
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/e2e/specs/site-editor/new-templates-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ test.describe( 'Templates', () => {
] );
} );
test( 'Sorting', async ( { admin, page } ) => {
await admin.visitSiteEditor( { path: '/wp_template/all' } );
await admin.visitSiteEditor( { path: '/wp_template' } );
// Switch to table layout.
await page.getByLabel( 'View options' ).click();
await page.getByRole( 'menuitem', { name: 'Layout' } ).click();
await page.getByRole( 'menuitemradio', { name: 'Table' } ).click();
// Descending by title.
await page
.getByRole( 'button', { name: 'Template', exact: true } )
Expand Down Expand Up @@ -48,7 +52,13 @@ test.describe( 'Templates', () => {
title: 'Date Archives',
content: 'hi',
} );
await admin.visitSiteEditor( { path: '/wp_template/all' } );
await admin.visitSiteEditor( { path: '/wp_template' } );

// Switch to table layout.
await page.getByLabel( 'View options' ).click();
await page.getByRole( 'menuitem', { name: 'Layout' } ).click();
await page.getByRole( 'menuitemradio', { name: 'Table' } ).click();

// Global search.
await page.getByRole( 'searchbox', { name: 'Filter list' } ).click();
await page.keyboard.type( 'tag' );
Expand Down Expand Up @@ -84,7 +94,13 @@ test.describe( 'Templates', () => {
await expect( titles ).toHaveCount( 2 );
} );
test( 'Field visibility', async ( { admin, page } ) => {
await admin.visitSiteEditor( { path: '/wp_template/all' } );
await admin.visitSiteEditor( { path: '/wp_template' } );

// Switch to table layout.
await page.getByLabel( 'View options' ).click();
await page.getByRole( 'menuitem', { name: 'Layout' } ).click();
await page.getByRole( 'menuitemradio', { name: 'Table' } ).click();

await page.getByRole( 'button', { name: 'Description' } ).click();
await page.getByRole( 'menuitem', { name: 'Hide' } ).click();
await expect(
Expand Down

0 comments on commit 84053ab

Please sign in to comment.