|
1 | 1 | import { expect } from '@playwright/test'; |
2 | 2 | import { configs, test } from '@utils/test/playwright'; |
3 | 3 |
|
4 | | -configs().forEach(({ title, screenshot, config }) => { |
5 | | - test.describe(title('datetime: ShowDaysOutsideCustomMonth'), () => { |
6 | | - test('with custom-grid should not have any visual regressions', async ({ page }) => { |
| 4 | +/** |
| 5 | + * This behavior does not vary across directions |
| 6 | + */ |
| 7 | +configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { |
| 8 | + test.describe(title('datetime: show adjacent days'), () => { |
| 9 | + test('should not have visual regressions', async ({ page }) => { |
7 | 10 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
8 | | - const customGrid = page.locator('#custom-grid'); |
9 | | - await expect(customGrid).toHaveScreenshot(screenshot(`customGrid-with-adjacent-days`)); |
| 11 | + const datetime = page.locator('#default'); |
| 12 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days`)); |
10 | 13 | }); |
11 | 14 |
|
12 | | - test('should set the first day of the week correctly', async ({ page }) => { |
| 15 | + test('should not have visual regressions with a custom styled calendar', async ({ page }) => { |
13 | 16 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
14 | | - const customDatetime = page.locator('#custom-calendar-days'); |
15 | | - await expect(customDatetime).toHaveScreenshot(screenshot(`custom-calendar-with-adjacent-days`)); |
| 17 | + const datetime = page.locator('#custom-calendar-days'); |
| 18 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-custom-calendar`)); |
16 | 19 | }); |
17 | 20 |
|
18 | | - test('with specific date disabled should not have any visual regressions', async ({ page }) => { |
| 21 | + test('should not have visual regressions with specific date disabled', async ({ page }) => { |
19 | 22 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
20 | | - const specificDateDisabled = page.locator('#specificDate'); |
21 | | - await expect(specificDateDisabled).toHaveScreenshot(screenshot(`specificDate-with-adjacent-days`)); |
| 23 | + const datetime = page.locator('#specificDate'); |
| 24 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-specific-date-disabled`)); |
22 | 25 | }); |
23 | 26 |
|
24 | | - test('with weekends disabled should not have any visual regressions', async ({ page }) => { |
| 27 | + test('should not have visual regressions with weekends disabled', async ({ page }) => { |
25 | 28 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
26 | | - const weekendsDisabled = page.locator('#weekends'); |
27 | | - await expect(weekendsDisabled).toHaveScreenshot(screenshot(`weekendsDisabled-with-adjacent-days`)); |
| 29 | + const datetime = page.locator('#weekends'); |
| 30 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-weekends-disabled`)); |
28 | 31 | }); |
29 | 32 |
|
30 | | - test('with date range disabled should not have any visual regressions', async ({ page }) => { |
| 33 | + test('should not have visual regressions with date range disabled', async ({ page }) => { |
31 | 34 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
32 | | - const dateRangeDisabled = page.locator('#dateRange'); |
33 | | - await expect(dateRangeDisabled).toHaveScreenshot(screenshot(`dateRangeDisabled-with-adjacent-days`)); |
| 35 | + const datetime = page.locator('#dateRange'); |
| 36 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-date-range-disabled`)); |
34 | 37 | }); |
35 | 38 |
|
36 | | - test('with month disabled should not have any visual regressions', async ({ page }) => { |
| 39 | + test('should not have visual regressions with month disabled', async ({ page }) => { |
37 | 40 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
38 | | - const monthDisabled = page.locator('#month'); |
39 | | - await expect(monthDisabled).toHaveScreenshot(screenshot(`monthDisabled-with-adjacent-days`)); |
| 41 | + const datetime = page.locator('#month'); |
| 42 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-month-disabled`)); |
40 | 43 | }); |
41 | 44 |
|
42 | | - test('with specific display should not have any visual regressions', async ({ page }) => { |
| 45 | + test('should not have visual regressions with display specified', async ({ page }) => { |
43 | 46 | await page.goto('/src/components/datetime/test/show-adjacent-days', config); |
44 | | - const display = page.locator('#display'); |
45 | | - await expect(display).toHaveScreenshot(screenshot(`display-with-adjacent-days`)); |
| 47 | + const datetime = page.locator('#display'); |
| 48 | + await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days-display`)); |
46 | 49 | }); |
47 | 50 | }); |
48 | 51 | }); |
0 commit comments