From a31fab894d718b0ff7d50a84110e82a7a49c8fc3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Feb 2023 22:42:37 +0100 Subject: [PATCH 1/3] fix --- code/ui/components/src/tabs/tabs.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ui/components/src/tabs/tabs.stories.tsx b/code/ui/components/src/tabs/tabs.stories.tsx index d4412c56715f..3399aa279c0c 100644 --- a/code/ui/components/src/tabs/tabs.stories.tsx +++ b/code/ui/components/src/tabs/tabs.stories.tsx @@ -202,7 +202,7 @@ export const StatefulDynamicWithOpenTooltip = { const canvas = within(canvasElement); await waitFor(async () => { - await expect(canvas.getAllByRole('tab')).toHaveLength(3); + await expect(canvas.getAllByRole('tab')).toHaveLength(4); await expect(canvas.getByRole('tab', { name: /Addons/ })).toBeInTheDocument(); }); From 707b93bac2f6fb5051da3e00c8434a549b6fef37 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Feb 2023 23:03:50 +0100 Subject: [PATCH 2/3] change viewport value --- code/ui/components/src/tabs/tabs.stories.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ui/components/src/tabs/tabs.stories.tsx b/code/ui/components/src/tabs/tabs.stories.tsx index 3399aa279c0c..26785c587301 100644 --- a/code/ui/components/src/tabs/tabs.stories.tsx +++ b/code/ui/components/src/tabs/tabs.stories.tsx @@ -196,7 +196,7 @@ export const StatefulDynamicWithOpenTooltip = { viewport: { defaultViewport: 'mobile2', }, - chromatic: { viewports: [414] }, + chromatic: { viewports: [380] }, }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); @@ -230,7 +230,7 @@ export const StatefulDynamicWithSelectedAddon = { viewport: { defaultViewport: 'mobile2', }, - chromatic: { viewports: [414] }, + chromatic: { viewports: [380] }, }, play: async (context) => { await StatefulDynamicWithOpenTooltip.play(context); From 4c63decad16358a4b7e1ab3f48c2fed8ddbae9ff Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Feb 2023 23:32:08 +0100 Subject: [PATCH 3/3] changing magic numbers in the middle of the night to get main branch to go green --- code/ui/components/src/tabs/tabs.stories.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/ui/components/src/tabs/tabs.stories.tsx b/code/ui/components/src/tabs/tabs.stories.tsx index 26785c587301..02a2927d5373 100644 --- a/code/ui/components/src/tabs/tabs.stories.tsx +++ b/code/ui/components/src/tabs/tabs.stories.tsx @@ -191,10 +191,21 @@ export const StatefulStaticWithSetBackgroundColor = { ), } satisfies Story; +const customViewports = { + chromatic: { + name: 'Chromatic', + styles: { + width: '380px', + height: '963px', + }, + }, +}; + export const StatefulDynamicWithOpenTooltip = { parameters: { viewport: { - defaultViewport: 'mobile2', + defaultViewport: 'chromatic', + viewports: customViewports, }, chromatic: { viewports: [380] }, }, @@ -202,7 +213,7 @@ export const StatefulDynamicWithOpenTooltip = { const canvas = within(canvasElement); await waitFor(async () => { - await expect(canvas.getAllByRole('tab')).toHaveLength(4); + await expect(canvas.getAllByRole('tab')).toHaveLength(3); await expect(canvas.getByRole('tab', { name: /Addons/ })).toBeInTheDocument(); }); @@ -228,7 +239,8 @@ export const StatefulDynamicWithOpenTooltip = { export const StatefulDynamicWithSelectedAddon = { parameters: { viewport: { - defaultViewport: 'mobile2', + defaultViewport: 'chromatic', + viewports: customViewports, }, chromatic: { viewports: [380] }, },