Skip to content

Commit

Permalink
Fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdkei authored and mtdkei committed Jan 31, 2025
1 parent 65ef45c commit f64b73a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/e2e/common-margin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe( 'Block', () => {
await page.getByRole('button', { name: 'Margin the block' }).click();
await page.getByRole('menuitem', { name: 'Top XL' }).click();

await expect( page.getByLabel('Block: Breadcrumb') ).toHaveClass(
await expect( editor.canvas.getByLabel('Block: Breadcrumb') ).toHaveClass(
'block-editor-block-list__block wp-block is-selected vk_block-margin-xl--margin-top wp-block-vk-blocks-breadcrumb'
);

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/global-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function globalSetup( config ) {

// Reset the test environment before running the tests.
await Promise.all( [
requestUtils.activateTheme( 'twentytwentyfour' ),
requestUtils.activateTheme( 'twentytwentyfive' ),
requestUtils.deleteAllPosts(),
requestUtils.deleteAllBlocks(),
requestUtils.resetPreferences(),
Expand Down
24 changes: 12 additions & 12 deletions test/e2e/heading-transform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ test.describe( 'Block', () => {
} );

// 文字を変更
await page.getByLabel('Input title…').click();
await page.getByLabel('Input title…').fill('aaaa');
await editor.canvas.getByLabel('Input title…').click();
await editor.canvas.getByLabel('Input title…').fill('aaaa');

// マージン変更
await page.locator('#inspector-input-control-0').click();
Expand All @@ -40,8 +40,8 @@ test.describe( 'Block', () => {

// サブテキスト
await page.getByLabel('Display', { exact: true }).check();
await page.getByLabel('Input sub text…').click();
await page.getByLabel('Input sub text…').fill('bbbb');
await editor.canvas.getByLabel('Input sub text…').click();
await editor.canvas.getByLabel('Input sub text…').fill('bbbb');
await page.locator('#inspector-input-control-3').click();
await page.locator('#inspector-input-control-3').fill('2');
await page.locator('#components-circular-option-picker-2-22').click();
Expand All @@ -51,27 +51,27 @@ test.describe( 'Block', () => {
await page.getByRole('menuitem', { name: 'Heading' }).click();

// 変換内容
await expect( page.locator( '.wp-block-heading' ) ).toHaveClass(
await expect( editor.canvas.locator( '.wp-block-heading' ) ).toHaveClass(
'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-accent-1-color has-text-color wp-block-heading rich-text'
);
await expect( page.locator( '.wp-block-heading' ) ).toHaveCSS(
await expect( editor.canvas.locator( '.wp-block-heading' ) ).toHaveCSS(
'margin-bottom',
'16px'
);
await expect( page.locator( 'p.has-text-color' ) ).toHaveCSS(
await expect( editor.canvas.locator( 'p.has-text-color' ) ).toHaveCSS(
'font-size',
'31.2896px'
'26.1152px'
);
await expect( page.locator( '.wp-block-heading' ) ).toHaveClass(
await expect( editor.canvas.locator( '.wp-block-heading' ) ).toHaveClass(
'block-editor-rich-text__editable block-editor-block-list__block wp-block is-multi-selected wp-elements-0 has-accent-1-color has-text-color wp-block-heading rich-text'
);
await expect( page.locator( '.wp-block-heading' ) ).toHaveCSS(
await expect( editor.canvas.locator( '.wp-block-heading' ) ).toHaveCSS(
'margin-bottom',
'16px'
);
await expect( page.locator( 'p.has-text-color' ) ).toHaveCSS(
await expect( editor.canvas.locator( 'p.has-text-color' ) ).toHaveCSS(
'font-size',
'31.2896px'
'26.1152px'
);

} );
Expand Down

0 comments on commit f64b73a

Please sign in to comment.