From 5ff32b77862f8d49694d93399b43ce543d07ffd9 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 19 Sep 2023 13:37:55 -0400 Subject: [PATCH] test(docs): update viewport docs (#28197) Issue number: N/A --------- ## What is the current behavior? I needed this constant for a different PR but realized the docs were outdated: https://github.com/ionic-team/ionic-framework/blob/81714d45bd97f0ba91729959b60a0dc1d1d06533/core/src/utils/test/playwright/viewports/index.ts ## What is the new behavior? - Docs reference correct constant name ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- core/src/utils/test/playwright/docs/best-practices.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/utils/test/playwright/docs/best-practices.md b/core/src/utils/test/playwright/docs/best-practices.md index aa63508ac4..79d79653de 100644 --- a/core/src/utils/test/playwright/docs/best-practices.md +++ b/core/src/utils/test/playwright/docs/best-practices.md @@ -187,17 +187,17 @@ Tests are distributed across many test runners on continuous integration (CI) to By default, we run tests on mobile viewports only (think iPhone sized viewports). However, there are some components that have different layouts on tablet viewports. Two examples are `ion-split-pane` and the card variant of `ion-modal`. -For this scenario, developers must write tests that target the tablet viewport. This can be done by using [page.setViewportSize](https://playwright.dev/docs/api/class-page#page-set-viewport-size). The Playwright test utils directory also contains a `TabletViewport` constant which can be used to take consistent tablet-sized screenshots. +For this scenario, developers must write tests that target the tablet viewport. This can be done by using [page.setViewportSize](https://playwright.dev/docs/api/class-page#page-set-viewport-size). The Playwright test utils directory also contains a `Viewports` constant which contains some common viewport presets. Developers should feel free to add new viewports to this as is applicable. **Example:** ```javascript -import { configs, test, TabletViewport } from '@utils/test/playwright'; +import { configs, test, Viewports } from '@utils/test/playwright'; configs().forEach(({ config, title }) => { test.describe(title('thing: rendering'), () => { test('it should do a thing on tablet viewports', async ({ page }) => { - await page.setViewportSize(TabletViewport); + await page.setViewportSize(Viewports.tablet.portrait); ...