1
+" +`; diff --git a/test/e2e-tests/specs/__snapshots__/highlighter-x-t9.test.js.snap b/test/e2e-tests/specs/__snapshots__/highlighter-x-t9.test.js.snap new file mode 100644 index 000000000..c7576e9db --- /dev/null +++ b/test/e2e-tests/specs/__snapshots__/highlighter-x-t9.test.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`x-t9 Highlighter x-t9 Highlighter 1`] = ` +" +1
+" +`; diff --git a/test/e2e-tests/specs/highlighter-lightning.test.js b/test/e2e-tests/specs/highlighter-lightning.test.js new file mode 100644 index 000000000..4dc980ebf --- /dev/null +++ b/test/e2e-tests/specs/highlighter-lightning.test.js @@ -0,0 +1,66 @@ +/** + * WordPress dependencies + */ + import { + pressKeyWithModifier, + createNewPost, + clickBlockAppender, + clickBlockToolbarButton, + getEditedPostContent, + activateTheme, + installTheme, +} from '@wordpress/e2e-test-utils'; + +/** + * Internal dependencies + */ + import { changeSiteLang } from '../helper/changeSiteLang'; + +describe( 'Lightning Highlighter', () => { + let oldLanguage; + beforeAll( async () => { + await installTheme( 'lightning' ); + await activateTheme( 'lightning' ); + } ); + beforeEach( async () => { + oldLanguage = await changeSiteLang( 'en' ); + await createNewPost(); + } ); + afterEach( async () => { + await changeSiteLang( oldLanguage ); + }); + afterAll( async () => { + await activateTheme( 'twentytwentytwo' ); + } ); + + it( 'Lightning Highlighter', async () => { + /** + * 新しく投稿を作る + */ + await createNewPost(); + + await clickBlockAppender(); + + // Add text and select to color. + await page.keyboard.type( '1' ); + await pressKeyWithModifier( 'primary', 'a' ); + await clickBlockToolbarButton( 'More' ); + + const button = await page.waitForXPath( + `//button[text()='Highlighter']` + ); + // Clicks may fail if the button is out of view. Assure it is before click. + await button.evaluate( ( element ) => element.scrollIntoView() ); + await button.click(); + + const option = await page.waitForSelector( + '[aria-label="Color: Black"]' + ); + + await option.click(); + + expect( await getEditedPostContent() ).toMatchSnapshot(); + + } ) + +}); diff --git a/test/e2e-tests/specs/highlighter-x-t9.test.js b/test/e2e-tests/specs/highlighter-x-t9.test.js new file mode 100644 index 000000000..f21d6a88a --- /dev/null +++ b/test/e2e-tests/specs/highlighter-x-t9.test.js @@ -0,0 +1,66 @@ +/** + * WordPress dependencies + */ + import { + pressKeyWithModifier, + createNewPost, + clickBlockAppender, + clickBlockToolbarButton, + getEditedPostContent, + activateTheme, + installTheme, +} from '@wordpress/e2e-test-utils'; + +/** + * Internal dependencies + */ + import { changeSiteLang } from '../helper/changeSiteLang'; + +describe( 'x-t9 Highlighter', () => { + let oldLanguage; + beforeAll( async () => { + await installTheme( 'x-t9' ); + await activateTheme( 'x-t9' ); + } ); + beforeEach( async () => { + oldLanguage = await changeSiteLang( 'en' ); + await createNewPost(); + } ); + afterEach( async () => { + await changeSiteLang( oldLanguage ); + }); + afterAll( async () => { + await activateTheme( 'twentytwentytwo' ); + } ); + + it( 'x-t9 Highlighter', async () => { + /** + * 新しく投稿を作る + */ + await createNewPost(); + + await clickBlockAppender(); + + // Add text and select to color. + await page.keyboard.type( '1' ); + await pressKeyWithModifier( 'primary', 'a' ); + await clickBlockToolbarButton( 'More' ); + + const button = await page.waitForXPath( + `//button[text()='Highlighter']` + ); + // Clicks may fail if the button is out of view. Assure it is before click. + await button.evaluate( ( element ) => element.scrollIntoView() ); + await button.click(); + + const option = await page.waitForSelector( + '[aria-label="Color: Text Secondary"]' + ); + + await option.click(); + + expect( await getEditedPostContent() ).toMatchSnapshot(); + + } ) + +}); diff --git a/test/phpunit/free/test-page-content.php b/test/phpunit/free/test-page-content.php index 376163b78..618dc3b6a 100644 --- a/test/phpunit/free/test-page-content.php +++ b/test/phpunit/free/test-page-content.php @@ -20,7 +20,7 @@ class PageContentBlockTest extends WP_UnitTestCase { /** * 各テストケースの実行直前に呼ばれる */ - public function setUp() { + public function setUp(): void { parent::setUp(); $page = array( @@ -35,7 +35,7 @@ public function setUp() { /** * Tear down each test method. */ - public function tearDown() { + public function tearDown(): void { wp_delete_post( $this->page_id, true ); $this->page_id = 0; } diff --git a/test/phpunit/pro/test-ancestor-page-list.php b/test/phpunit/pro/test-ancestor-page-list.php index 3483fc239..60d3daf22 100644 --- a/test/phpunit/pro/test-ancestor-page-list.php +++ b/test/phpunit/pro/test-ancestor-page-list.php @@ -77,6 +77,17 @@ public function test_vk_blocks_get_ancestor_page_list_title() { 'target_url' => get_permalink( $data['child_page_id'] ), 'correct' => '