-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kit): fix
CalendarRange
switch month with maxLength
- Loading branch information
Showing
6 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
projects/demo-playwright/tests/kit/calendar-range/calendar-range.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { | ||
TuiCalendarRangePO, | ||
TuiDocumentationPagePO, | ||
tuiGoto, | ||
} from '@demo-playwright/utils'; | ||
import {expect, Locator, test} from '@playwright/test'; | ||
|
||
const {describe, beforeEach} = test; | ||
|
||
describe('CalendarRange', () => { | ||
describe('API', () => { | ||
let documentationPage: TuiDocumentationPagePO; | ||
let example: Locator; | ||
let calendarRange: TuiCalendarRangePO; | ||
|
||
beforeEach(({page}) => { | ||
documentationPage = new TuiDocumentationPagePO(page); | ||
example = documentationPage.apiPageExample; | ||
calendarRange = new TuiCalendarRangePO(example.locator('tui-calendar-range')); | ||
}); | ||
|
||
test('When click on right calendar, months not switch', async ({page}) => { | ||
await tuiGoto(page, 'components/calendar-range/API?maxLength$=0'); | ||
await calendarRange.clickRightCalendar(); | ||
|
||
await documentationPage.prepareApiPageBeforeScreenshot(); | ||
await expect(page).toHaveScreenshot('calendar-range-max-length-click.png'); | ||
Check failure on line 27 in projects/demo-playwright/tests/kit/calendar-range/calendar-range.spec.ts GitHub Actions / playwright / (3 of 4)[chromium] › tests/kit/calendar-range/calendar-range.spec.ts:22:13 › CalendarRange › API › When click on right calendar
Check failure on line 27 in projects/demo-playwright/tests/kit/calendar-range/calendar-range.spec.ts GitHub Actions / playwright / (3 of 4)[chromium] › tests/kit/calendar-range/calendar-range.spec.ts:22:13 › CalendarRange › API › When click on right calendar
|
||
}); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
projects/demo-playwright/utils/page-objects/calendar-range.po.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Locator} from '@playwright/test'; | ||
|
||
export class TuiCalendarRangePO { | ||
constructor(private readonly host: Locator) {} | ||
|
||
async clickRightCalendar(): Promise<void> { | ||
return this.host | ||
.locator('[automation-id="tui-calendar__calendar"]') | ||
.last() | ||
.click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters