Skip to content

Commit

Permalink
Adjust tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed May 29, 2024
1 parent 6964b73 commit 4f2963b
Showing 1 changed file with 15 additions and 14 deletions.
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 4f2963b

Please sign in to comment.