Skip to content

Commit

Permalink
Workaround fixes for datepicker display bug in Cypress tests (#3967)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena authored Jul 10, 2019
1 parent 5149bf6 commit 7bf84e8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions client/cypress/integration/query/parameter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ describe('Parameter', () => {
.click();

cy.get('.ant-calendar-date-panel')
.click() // workaround for datepicker display bug
.contains('.ant-calendar-date', '15')
.click();

Expand Down Expand Up @@ -192,16 +193,21 @@ describe('Parameter', () => {
it('updates the results after selecting a date and clicking in ok', () => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.as('Input')
.click();

cy.get('.ant-calendar-date-panel')
.contains('.ant-calendar-date', '15')
.as('SelectedDate')
.click();

cy.get('.ant-calendar-ok-btn')
.click();

cy.get('.ant-calendar-input').then(($input) => {
// workaround for datepicker display bug
cy.get('@SelectedDate').click();

cy.get('@Input').then(($input) => {
const now = Cypress.moment($input.val(), 'DD/MM/YY HH:mm');
cy.getByTestId('DynamicTable')
.should('contain', now.format('YYYY-MM-15 HH:mm'));
Expand All @@ -211,13 +217,15 @@ describe('Parameter', () => {
it('shows the current datetime after clicking in Now', () => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.as('Input')
.click();

cy.get('.ant-calendar-date-panel')
.contains('Now')
.click();
.click()
.click(); // workaround for datepicker display bug

cy.get('.ant-calendar-input').then(($input) => {
cy.get('@Input').then(($input) => {
const now = Cypress.moment($input.val(), 'DD/MM/YY HH:mm');
cy.getByTestId('DynamicTable')
.should('contain', now.format('YYYY-MM-01 HH:mm'));
Expand Down

0 comments on commit 7bf84e8

Please sign in to comment.