Skip to content

Commit 4ba73b0

Browse files
- add visual tests to new feature;
1 parent 7fe2359 commit 4ba73b0

File tree

98 files changed

+234
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+234
-180
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { expect } from '@playwright/test';
2+
import { configs, test } from '@utils/test/playwright';
3+
4+
configs().forEach(({ title, screenshot, config }) => {
5+
6+
test.describe(title('datetime: ShowDaysOutsideCustomMonth'), () => {
7+
test('with custom-grid should not have any visual regressions', async ({ page }) => {
8+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
9+
const customGrid = page.locator('#custom-grid');
10+
await expect(customGrid).toHaveScreenshot(screenshot(`customGrid-with-hidden-days`));
11+
});
12+
13+
test('with custom-wheel should not have any visual regressions', async ({ page }) => {
14+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
15+
const customWheel = page.locator('#custom-wheel');
16+
await expect(customWheel).toHaveScreenshot(screenshot(`custom-wheel-with-hidden-days`));
17+
});
18+
19+
test('should set the first day of the week correctly', async ({ page }) => {
20+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
21+
const customDatetime = page.locator('#custom-calendar-days');
22+
await expect(customDatetime).toHaveScreenshot(screenshot(`custom-calendar-with-hidden-days`));
23+
});
24+
25+
test('with specific date disabled should not have any visual regressions', async ({ page }) => {
26+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
27+
const specificDateDisabled = page.locator('#specificDate');
28+
await expect(specificDateDisabled).toHaveScreenshot(screenshot(`specificDate-with-hidden-days`));
29+
});
30+
31+
test('with weekends disabled should not have any visual regressions', async ({ page }) => {
32+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
33+
const weekendsDisabled = page.locator('#weekends');
34+
await expect(weekendsDisabled).toHaveScreenshot(screenshot(`weekendsDisabled-with-hidden-days`));
35+
});
36+
37+
test('with date range disabled should not have any visual regressions', async ({ page }) => {
38+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
39+
const dateRangeDisabled = page.locator('#dateRange');
40+
await expect(dateRangeDisabled).toHaveScreenshot(screenshot(`dateRangeDisabled-with-hidden-days`));
41+
});
42+
43+
test('with month disabled should not have any visual regressions', async ({ page }) => {
44+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
45+
const monthDisabled = page.locator('#month');
46+
await expect(monthDisabled).toHaveScreenshot(screenshot(`monthDisabled-with-hidden-days`));
47+
});
48+
49+
test('with specific display should not have any visual regressions', async ({ page }) => {
50+
await page.goto('/src/components/datetime/test/showDaysOutsideCurrentMonth', config);
51+
const display = page.locator('#display');
52+
await expect(display).toHaveScreenshot(screenshot(`display-with-hidden-days`));
53+
});
54+
});
55+
});
56+

0 commit comments

Comments
 (0)