-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: datepicker doesnt close on first selection of date on month change
- Loading branch information
1 parent
5d879ec
commit d94581a
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker4_spec.js
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,42 @@ | ||
import { | ||
draggableWidgets, | ||
entityExplorer, | ||
agHelper, | ||
} from "../../../../../support/Objects/ObjectsCore"; | ||
import * as _ from "../../../../../support/Objects/ObjectsCore"; | ||
import { datePickerlocators } from "../../../../../locators/WidgetLocators"; | ||
|
||
describe( | ||
"DatePicker Widget Property pane tests with js bindings", | ||
{ tags: ["@tag.Widget", "@tag.Datepicker"] }, | ||
function () { | ||
before(() => { | ||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.DATEPICKER); | ||
}); | ||
|
||
function navigateAndSelectRandomDate(direction) { | ||
const buttonClass = | ||
direction === "prev" | ||
? ".DayPicker-NavButton--prev" | ||
: ".DayPicker-NavButton--next"; | ||
agHelper.AssertElementVisibility(buttonClass, true, 0); | ||
agHelper.GetNClick(buttonClass); | ||
cy.get(".DayPicker-Month") | ||
.first() | ||
.find(".DayPicker-Day") | ||
.then(($days) => { | ||
const randomIndex = Math.floor(Math.random() * $days.length); | ||
cy.wrap($days[randomIndex]).click(); | ||
}); | ||
} | ||
|
||
it("1.should close datepicker on single click when month is changed", function () { | ||
agHelper.GetNClick(datePickerlocators.input); | ||
navigateAndSelectRandomDate("prev"); | ||
agHelper.GetNClick(datePickerlocators.input); | ||
navigateAndSelectRandomDate("prev"); | ||
agHelper.GetNClick(datePickerlocators.input); | ||
navigateAndSelectRandomDate("next"); | ||
}); | ||
}, | ||
); |
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