Skip to content

Commit

Permalink
Fix after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Jun 5, 2024
1 parent 44e2147 commit 1ca155e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import {
__experimentalVStack as VStack,
Button,
} from '@wordpress/components';
<<<<<<< HEAD
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { settings } from '@wordpress/icons';
=======
>>>>>>> 72a59c77a0 (Replace Manage fonts icon button with visible text button.)
import { useContext } from '@wordpress/element';

/**
Expand Down Expand Up @@ -73,7 +69,9 @@ function FontFamilies() {
<Button
className="edit-site-global-styles-font-families__manage-fonts"
variant="secondary"
onClick={ () => setModalTabOpen( 'installed-fonts' ) }
onClick={ () =>
setModalTabOpen( 'installed-fonts' )
}
>
{ __( 'Manage fonts' ) }
</Button>
Expand Down
29 changes: 15 additions & 14 deletions test/e2e/specs/site-editor/font-library.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ test.describe( 'Font Library', () => {
await editor.canvas.locator( 'body' ).click();
} );

test( 'should display the "Manage Fonts" icon', async ( { page } ) => {
test( 'should display the "Add fonts" button', async ( { page } ) => {
await page.getByRole( 'button', { name: 'Styles' } ).click();
await page
.getByRole( 'button', { name: 'Typography Styles' } )
.click();
const manageFontsIcon = page.getByRole( 'button', {
name: 'Manage Fonts',
const addFontsButton = page.getByRole( 'button', {
name: 'Add fonts',
} );
await expect( manageFontsIcon ).toBeVisible();
await expect( addFontsButton ).toBeVisible();
} );
} );

Expand All @@ -36,18 +36,20 @@ test.describe( 'Font Library', () => {
await editor.canvas.locator( 'body' ).click();
} );

test( 'should display the "Manage Fonts" icon', async ( { page } ) => {
test( 'should display the "Manage fonts" button', async ( {
page,
} ) => {
await page.getByRole( 'button', { name: 'Styles' } ).click();
await page
.getByRole( 'button', { name: 'Typography Styles' } )
.click();
const manageFontsIcon = page.getByRole( 'button', {
name: 'Manage Fonts',
const manageFontsButton = page.getByRole( 'button', {
name: 'Manage fonts',
} );
await expect( manageFontsIcon ).toBeVisible();
await expect( manageFontsButton ).toBeVisible();
} );

test( 'should open the "Manage Fonts" modal when clicking the "Manage Fonts" icon', async ( {
test( 'should open the "Manage fonts" modal when clicking the "Manage fonts" button', async ( {
page,
} ) => {
await page.getByRole( 'button', { name: 'Styles' } ).click();
Expand All @@ -56,7 +58,7 @@ test.describe( 'Font Library', () => {
.click();
await page
.getByRole( 'button', {
name: 'Manage Fonts',
name: 'Manage fonts',
} )
.click();
await expect( page.getByRole( 'dialog' ) ).toBeVisible();
Expand All @@ -74,7 +76,7 @@ test.describe( 'Font Library', () => {
.click();
await page
.getByRole( 'button', {
name: 'Manage Fonts',
name: 'Manage fonts',
} )
.click();
await page.getByRole( 'button', { name: 'System Font' } ).click();
Expand Down Expand Up @@ -120,12 +122,11 @@ test.describe( 'Font Library', () => {
.click();
await page
.getByRole( 'button', {
name: 'Manage Fonts',
name: 'Add fonts',
} )
.click();

// Upload local fonts.
await page.getByRole( 'tab', { name: 'Upload' } ).click();
const fileChooserPromise = page.waitForEvent( 'filechooser' );
await page.getByRole( 'button', { name: 'Upload Font' } ).click();
const fileChooser = await fileChooserPromise;
Expand Down Expand Up @@ -163,7 +164,7 @@ test.describe( 'Font Library', () => {
await page.getByRole( 'button', { name: 'Back' } ).click();
await page
.getByRole( 'button', {
name: 'Manage Fonts',
name: 'Manage fonts',
} )
.click();

Expand Down

0 comments on commit 1ca155e

Please sign in to comment.