From 50d2e061777526d3fe0a3196ddee5a0b855be58d Mon Sep 17 00:00:00 2001 From: Eshaan Dabasiya <76681468+im3dabasia@users.noreply.github.com> Date: Sat, 4 Jan 2025 08:35:40 +0530 Subject: [PATCH 1/2] StoryBook: Add Story for ResolutionTool (#68292) * merge trunk into storybook/resolution-control * refactor: Add argtypes and description in meta Co-authored-by: im3dabasia Co-authored-by: t-hamano --- .../resolution-tool/stories/index.story.js | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/resolution-tool/stories/index.story.js b/packages/block-editor/src/components/resolution-tool/stories/index.story.js index 531618b38224f..08cf9ef6c5378 100644 --- a/packages/block-editor/src/components/resolution-tool/stories/index.story.js +++ b/packages/block-editor/src/components/resolution-tool/stories/index.story.js @@ -16,9 +16,59 @@ export default { title: 'BlockEditor/ResolutionControl', component: ResolutionTool, tags: [ 'status-private' ], + parameters: { + docs: { + canvas: { sourceState: 'shown' }, + description: { + component: + 'A control for selecting image resolution with preset size options.', + }, + }, + }, argTypes: { - panelId: { control: false }, - onChange: { action: 'changed' }, + value: { + control: { type: null }, + description: 'Currently selected resolution value.', + table: { type: { summary: 'string' } }, + }, + onChange: { + action: 'onChange', + control: { type: null }, + description: 'Handles change in resolution selection.', + table: { + type: { summary: 'function' }, + }, + }, + options: { + control: 'object', + description: 'Array of resolution options to display.', + table: { + type: { summary: 'array' }, + }, + }, + defaultValue: { + control: 'radio', + options: [ 'thumbnail', 'medium', 'large', 'full' ], + description: 'Default resolution value.', + table: { + type: { summary: 'string' }, + }, + }, + isShownByDefault: { + control: 'boolean', + description: + 'Whether the control is shown by default in the panel.', + table: { + type: { summary: 'boolean' }, + }, + }, + panelId: { + control: { type: null }, + description: 'ID of the parent tools panel.', + table: { + type: { summary: 'string' }, + }, + }, }, }; From 3416bf4b0db6679b86e8e4226cbdb0d3387b25d7 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Sat, 4 Jan 2025 12:15:19 +0900 Subject: [PATCH 2/2] Site Editor: fix "Quick Edit Mode" E2E tests (#68484) Co-authored-by: t-hamano --- test/e2e/specs/site-editor/page-list.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/specs/site-editor/page-list.spec.js b/test/e2e/specs/site-editor/page-list.spec.js index 120ded6a2b6d0..88c8c16ff482a 100644 --- a/test/e2e/specs/site-editor/page-list.spec.js +++ b/test/e2e/specs/site-editor/page-list.spec.js @@ -290,7 +290,7 @@ test.describe( 'Page List', () => { await page.getByRole( 'button', { name: 'Layout' } ).click(); await page.getByRole( 'menuitemradio', { name: 'Table' } ).click(); const privacyPolicyCheckbox = page.getByRole( 'checkbox', { - name: 'Select Item: Privacy Policy', + name: 'Privacy Policy', } ); await privacyPolicyCheckbox.check(); @@ -352,7 +352,7 @@ test.describe( 'Page List', () => { // page, // } ) => { // const samplePage = page.getByRole( 'checkbox', { - // name: 'Select Item: Sample Page', + // name: 'Sample Page', // } ); // await samplePage.check();