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

DataViews: make filters footprint more condensed #56983

Merged
merged 21 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Update e2e tests
  • Loading branch information
oandregal committed Dec 13, 2023
commit 1a8c1c1402f53f16329128326d6ceed5795b17c8
1 change: 1 addition & 0 deletions packages/dataviews/src/add-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default function AddFilter( { filters, view, onChangeView } ) {
trigger={
<Button
__experimentalIsFocusable
label={ __( 'Filters' ) }
variant="tertiary"
size="compact"
icon={ funnel }
Expand Down
16 changes: 11 additions & 5 deletions test/e2e/specs/site-editor/new-templates-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ test.describe( 'Templates', () => {
await page.keyboard.type( 'tag' );
const titles = page
.getByRole( 'region', { name: 'Template' } )
.getByRole( 'link' );
.getByRole( 'link', { includeHidden: true } );
await expect( titles ).toHaveCount( 1 );
await expect( titles.first() ).toHaveText( 'Tag Archives' );
await page.getByRole( 'button', { name: 'Reset filters' } ).click();
await expect( titles ).toHaveCount( 6 );

// Filter by author.
await page.getByRole( 'button', { name: 'Add filter' } ).click();
await page
.getByRole( 'button', { name: 'Filters', exact: true } )
.click();
await page.getByRole( 'menuitem', { name: 'Author' } ).hover();
await page.getByRole( 'menuitem', { name: 'admin' } ).click();
await page.getByRole( 'menuitemradio', { name: 'admin' } ).click();
await page.keyboard.press( 'Escape' ); // close the menu.
await expect( titles ).toHaveCount( 1 );
await expect( titles.first() ).toHaveText( 'Date Archives' );

Expand All @@ -72,9 +75,12 @@ test.describe( 'Templates', () => {
await page.getByRole( 'searchbox', { name: 'Filter list' } ).click();
await page.keyboard.type( 'archives' );
await expect( titles ).toHaveCount( 3 );
await page.getByRole( 'button', { name: 'Add filter' } ).click();
await page
.getByRole( 'button', { name: 'Filters', exact: true } )
.click();
await page.getByRole( 'menuitem', { name: 'Author' } ).hover();
await page.getByRole( 'menuitem', { name: 'Emptytheme' } ).click();
await page.getByRole( 'menuitemradio', { name: 'Emptytheme' } ).click();
await page.keyboard.press( 'Escape' ); // close the menu.
await expect( titles ).toHaveCount( 2 );
} );
test( 'Field visibility', async ( { admin, page } ) => {
Expand Down