Skip to content

Commit

Permalink
[frontend]test DatePicker(#6704)
Browse files Browse the repository at this point in the history
Signed-off-by: Celine Sebe <celine.sebe@filigran.io>
  • Loading branch information
CelineSebe committed May 30, 2024
1 parent 06fadd0 commit 858323e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ const WorkspaceHeader = ({
clearable={true}
disableFuture={true}
disabled={true}
aria-label="start picker"
onChange={(value, context) => !context.validationError && handleDateChange('startDate', value)}
slotProps={{
textField: {
Expand All @@ -277,6 +278,7 @@ const WorkspaceHeader = ({
clearable={true}
disabled={true}
disableFuture={true}
aria-label="end picker"
onChange={(value, context) => !context.validationError && handleDateChange('endDate', value)}
slotProps={{
textField: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ test('Dashboard CRUD', async ({ page }) => {
await dashboardPage.getItemFromList(updateDashboardName).click();
await expect(dashboardDetailsPage.getDashboardDetailsPage()).toBeVisible();

await expect(dashboardDetailsPage.getDatePicker()).toBeEnabled();
await dashboardDetailsPage.getDatePicker().click();
await dashboardDetailsPage.getTime().click();
await expect(dashboardDetailsPage.getListBox()).toBeVisible();
await dashboardDetailsPage.getOneYear('year').click();

await expect(dashboardDetailsPage.getDatePicker()).toBeDisabled();
// ---------
// endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class DashboardDetailsPage {
return this.page.getByRole('button', { name: 'Delete' });
}

// Catch tag
// addNewDashboardTag() {
// return this.page.getByLabel('Add tag');
// }
Expand All @@ -43,20 +44,12 @@ export default class DashboardDetailsPage {
return this.page.getByRole('combobox', { expanded: false });
}

selectTime() {
return this.page.getByRole('combobox', { expanded: true });
}

getOneYear(time: string) {
return this.page.getByRole('option', { name: time });
}

getStartDate() {
return this.page.getByLabel('Start date').click;
}

getEndDate() {
return this.page.getByLabel('End date').click;
getDatePicker() {
return this.page.getByLabel('Start date');
}

getListBox() {
Expand Down

0 comments on commit 858323e

Please sign in to comment.