diff --git a/playwright/playwright.config.ts b/playwright/playwright.config.ts index 802d1b97cb..095a289547 100644 --- a/playwright/playwright.config.ts +++ b/playwright/playwright.config.ts @@ -76,6 +76,12 @@ const config: PlaywrightTestConfig = { deviceScaleFactor: 2, }, }, + { + name: 'Mobile Safari', + use: { + ...devices['iPhone 13'], + }, + }, ], }; diff --git a/playwright/playwright/index.tsx b/playwright/playwright/index.tsx index 80a9ffdc4a..949ec5990a 100644 --- a/playwright/playwright/index.tsx +++ b/playwright/playwright/index.tsx @@ -3,7 +3,6 @@ import React from 'react'; import {beforeMount} from '@playwright/experimental-ct-react/hooks'; import {ToasterProvider} from '../../src/components/Toaster'; -import {MobileProvider} from '../../src/components/mobile/MobileProvider'; import {ThemeProvider} from '../../src/components/theme/ThemeProvider'; import './index.scss'; @@ -11,11 +10,9 @@ import './index.scss'; beforeMount(async ({App}) => { return ( - - - - - + + + ); }); diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-Mobile-Safari-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-Mobile-Safari-linux.png new file mode 100644 index 0000000000..40add40adc Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-Mobile-Safari-linux.png differ diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-chromium-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-chromium-linux.png new file mode 100644 index 0000000000..847b73f60c Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-chromium-linux.png differ diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-webkit-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-webkit-linux.png new file mode 100644 index 0000000000..b5d6b7203a Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-dark-webkit-linux.png differ diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-Mobile-Safari-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-Mobile-Safari-linux.png new file mode 100644 index 0000000000..d5b4d95367 Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-Mobile-Safari-linux.png differ diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-chromium-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-chromium-linux.png new file mode 100644 index 0000000000..a714a9642f Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-chromium-linux.png differ diff --git a/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-webkit-linux.png b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-webkit-linux.png new file mode 100644 index 0000000000..8466ac718b Binary files /dev/null and b/src/components/Button/__snapshots__/ButtonMobile.visual.test.tsx-snapshots/Button-Mobile-render-story-Default-light-webkit-linux.png differ diff --git a/src/components/Button/__tests__/ButtonMobile.visual.test.tsx b/src/components/Button/__tests__/ButtonMobile.visual.test.tsx new file mode 100644 index 0000000000..de099e0332 --- /dev/null +++ b/src/components/Button/__tests__/ButtonMobile.visual.test.tsx @@ -0,0 +1,24 @@ +import React from 'react'; + +import {test} from '~playwright/core'; + +import {MobileProvider} from '../../../components/mobile'; + +import {ButtonStories} from './helpersPlaywright'; + +test.describe('Button Mobile', {tag: '@Button @Mobile'}, () => { + test.use({ + viewport: {width: 390, height: 844}, + isMobile: true, + }); + + test('render story: ', async ({mount, expectScreenshot}) => { + await mount( + + + , + ); + + await expectScreenshot(); + }); +});