Skip to content

Commit

Permalink
Adjust more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Jan 13, 2025
1 parent 60c77d0 commit ecdd4cd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/palette-edit/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe( 'PaletteEdit', () => {
/>
);

await click( screen.getByLabelText( 'Color: Primary' ) );
await click( screen.getByLabelText( 'Primary' ) );
const hexInput = screen.getByRole( 'textbox', {
name: 'Hex color',
} );
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/specs/editor/blocks/cover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe( 'Cover', () => {

// Locate the Black color swatch.
const blackColorSwatch = coverBlock.getByRole( 'option', {
name: 'Color: Black',
name: 'Black',
} );
await expect( blackColorSwatch ).toBeVisible();

Expand Down Expand Up @@ -106,7 +106,7 @@ test.describe( 'Cover', () => {
// a functioning block.
await coverBlock
.getByRole( 'option', {
name: 'Color: Black',
name: 'Black',
} )
.click();

Expand All @@ -129,7 +129,7 @@ test.describe( 'Cover', () => {
} );
await coverBlock
.getByRole( 'option', {
name: 'Color: Black',
name: 'Black',
} )
.click();

Expand Down Expand Up @@ -241,7 +241,7 @@ test.describe( 'Cover', () => {
// a functioning block.
await coverBlock
.getByRole( 'option', {
name: 'Color: Black',
name: 'Black',
} )
.click();

Expand All @@ -267,7 +267,7 @@ test.describe( 'Cover', () => {
// a functioning block.
await secondCoverBlock
.getByRole( 'option', {
name: 'Color: Black',
name: 'Black',
} )
.click();

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/blocks/heading.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ test.describe( 'Heading', () => {

await page
.getByRole( 'option', {
name: 'Color: Luminous vivid orange',
name: 'Luminous vivid orange',
} )
.click();

Expand Down
20 changes: 10 additions & 10 deletions test/e2e/specs/editor/blocks/navigation-colors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ test.describe( 'Navigation colors', () => {
await page.getByRole( 'tab', { name: 'Styles' } ).click();
await page.getByRole( 'button', { name: 'Text' } ).click();
await page
.getByRole( 'option', { name: 'Color: White' } )
.getByRole( 'option', { name: 'White' } )
.click( { force: true } );

await page
.getByRole( 'button', { name: 'Background', exact: true } )
.click();
await page
.getByRole( 'option', { name: 'Color: Black' } )
.getByRole( 'option', { name: 'Black' } )
.click( { force: true } );

// Close the sidebar so our selectors don't accidentally select the sidebar links instead of the editor canvas.
Expand Down Expand Up @@ -151,12 +151,12 @@ test.describe( 'Navigation colors', () => {
await page.getByRole( 'button', { name: 'Link', exact: true } ).click();
// rga(207, 46 ,46) is the color of the "vivid red" color preset.
await page
.getByRole( 'option', { name: 'Color: Vivid red' } )
.getByRole( 'option', { name: 'Vivid red' } )
.click( { force: true } );
await page.getByRole( 'tab', { name: 'Hover' } ).click();
// rgb(155, 81, 224) is the color of the "vivid purple" color preset.
await page
.getByRole( 'option', { name: 'Color: Vivid purple' } )
.getByRole( 'option', { name: 'Vivid purple' } )
.click( { force: true } );

// Close the sidebar so our selectors don't accidentally select the sidebar links instead of the editor canvas.
Expand Down Expand Up @@ -198,7 +198,7 @@ test.describe( 'Navigation colors', () => {
// 247, 141, 167 is the color of the "Pale pink" color preset.
const palePink = 'rgb(247, 141, 167)';
await page
.getByRole( 'option', { name: 'Color: Pale pink' } )
.getByRole( 'option', { name: 'Pale pink' } )
.click( { force: true } );

// Close the sidebar so our selectors don't accidentally select the sidebar links instead of the editor canvas.
Expand Down Expand Up @@ -242,7 +242,7 @@ test.describe( 'Navigation colors', () => {
// 142, 209, 252 is the color of the "Pale cyan blue" color preset.
const paleCyan = 'rgb(142, 209, 252)';
await page
.getByRole( 'option', { name: 'Color: Pale cyan blue' } )
.getByRole( 'option', { name: 'Pale cyan blue' } )
.click( { force: true } );

// Close the sidebar so our selectors don't accidentally select the sidebar links instead of the editor canvas.
Expand Down Expand Up @@ -285,7 +285,7 @@ test.describe( 'Navigation colors', () => {
// 247, 141, 167 is the color of the "Pale pink" color preset.
const palePink = 'rgb(247, 141, 167)';
await page
.getByRole( 'option', { name: 'Color: Pale pink' } )
.getByRole( 'option', { name: 'Pale pink' } )
.click( { force: true } );
// Pale cyan blue for the background color.
await page
Expand All @@ -294,7 +294,7 @@ test.describe( 'Navigation colors', () => {
// 142, 209, 252 is the color of the "Pale cyan blue" color preset.
const paleCyan = 'rgb(142, 209, 252)';
await page
.getByRole( 'option', { name: 'Color: Pale cyan blue' } )
.getByRole( 'option', { name: 'Pale cyan blue' } )
.click( { force: true } );
// Cyan bluish gray for the submenu and overlay text color.
await page
Expand All @@ -303,7 +303,7 @@ test.describe( 'Navigation colors', () => {
// 171, 184, 195 is the color of the "Cyan bluish gray" color preset.
const cyanBluishGray = 'rgb(171, 184, 195)';
await page
.getByRole( 'option', { name: 'Color: Cyan bluish gray' } )
.getByRole( 'option', { name: 'Cyan bluish gray' } )
.click( { force: true } );
// Luminous vivid amber for the submenu and overlay background color.
await page
Expand All @@ -312,7 +312,7 @@ test.describe( 'Navigation colors', () => {
// 252, 185, 0 is the color of the "Luminous vivid amber" color preset.
const vividAmber = 'rgb(252, 185, 0)';
await page
.getByRole( 'option', { name: 'Color: Luminous vivid amber' } )
.getByRole( 'option', { name: 'Luminous vivid amber' } )
.click( { force: true } );

// Close the sidebar so our selectors don't accidentally select the sidebar links instead of the editor canvas.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe( 'Format Library - Text color', () => {
// active. Previously we had a broken regular expression.
const color = page
.getByRole( 'listbox', { name: 'Custom color picker' } )
.getByRole( 'option', { name: 'Color: Cyan bluish gray' } );
.getByRole( 'option', { name: 'Cyan bluish gray' } );

await color.click();
await expect.poll( editor.getBlocks ).toMatchObject( [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test.describe( 'Style Revisions', () => {
.getByRole( 'button', { name: 'Background', exact: true } )
.click();
await page
.getByRole( 'option', { name: 'Color: Luminous vivid amber' } )
.getByRole( 'option', { name: 'Luminous vivid amber' } )
.click( { force: true } );

await page.getByRole( 'button', { name: 'Revisions' } ).click();
Expand Down

0 comments on commit ecdd4cd

Please sign in to comment.