Skip to content

Commit

Permalink
Testing: Assert that the warning for insuffiecient contrast is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Jan 23, 2025
1 parent 192b43b commit 327aa3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/specs/editor/various/contrast-checker.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { test } = require( '@wordpress/e2e-test-utils-playwright' );
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'ContrastChecker', () => {
test.beforeEach( async ( { admin } ) => {
Expand Down Expand Up @@ -35,5 +35,11 @@ test.describe( 'ContrastChecker', () => {
await page.click(
'button.components-circular-option-picker__option[aria-label="Black"]'
);

const warningElement = page.locator( '.block-editor-contrast-checker' );
await expect( warningElement ).toBeVisible();
await expect( warningElement ).toContainText(
'This color combination may be hard for people to read'
);
} );
} );

0 comments on commit 327aa3f

Please sign in to comment.