Skip to content

Commit

Permalink
Add gantt chart fix for different timezones in 1.1 (#1727)
Browse files Browse the repository at this point in the history
* add fix for different timezones

Signed-off-by: Ritvi Bhatt <[email protected]>

* update artifact action to v4

Signed-off-by: Ritvi Bhatt <[email protected]>

* update workflow

Signed-off-by: Ritvi Bhatt <[email protected]>

* update workflow

Signed-off-by: Ritvi Bhatt <[email protected]>

* change time format test to match 1.2

Signed-off-by: Ritvi Bhatt <[email protected]>

* fix typos

Signed-off-by: Ritvi Bhatt <[email protected]>

---------

Signed-off-by: Ritvi Bhatt <[email protected]>
Co-authored-by: Ritvi Bhatt <[email protected]>
  • Loading branch information
ritvibhatt and Ritvi Bhatt authored Feb 27, 2025
1 parent ea66a1e commit 4c47dcb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress-workflow-bundle-snapshot-based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ jobs:
command: yarn cypress:run-with-security --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/*.js'
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: monterey-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ jobs:
command: yarn cypress:run-plugin-tests-with-security
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: monterey-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cypress-workflow-vanilla-snapshot-based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ jobs:
command: yarn cypress:run-without-security --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: monetery-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
path: monetery-test/cypress/videos
# Test reports was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-results
Expand Down
56 changes: 44 additions & 12 deletions cypress/integration/plugins/gantt-chart-dashboards/gantt_ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/// <reference types="cypress" />

import { BASE_PATH } from '../../../utils/constants';
import moment from 'moment';

const delay = 100;
const GANTT_VIS_NAME =
Expand Down Expand Up @@ -169,37 +170,68 @@ describe('Configure panel settings', () => {
});

it('Changes time formats', () => {
cy.contains('12:59:07.303 PM').should('exist');

cy.get('select').eq(3).select('MM/DD hh:mm:ss A');
cy.wait(delay);
cy.get('.euiButton__text').contains('Update').click({ force: true });
cy.wait(delay);
cy.contains('05/28 12:59:07 PM').should('exist');
cy.wait(1000);
cy.get('.xtick')
.eq(0)
.invoke('text')
.then((text) => {
expect(
moment(text, 'MM/DD hh:mm:ss A').format('MM/DD hh:mm:ss A')
).equal(text);
});

cy.get('select').eq(3).select('MM/DD/YY hh:mm A');
cy.wait(delay);
cy.get('.euiButton__text').contains('Update').click({ force: true });
cy.wait(delay);
cy.contains('05/28/20 12:59 PM').should('exist');
cy.wait(1000);
cy.get('.xtick')
.eq(0)
.invoke('text')
.then((text) => {
expect(
moment(text, 'MM/DD/YY hh:mm A').format('MM/DD/YY hh:mm A')
).equal(text);
});

cy.get('select').eq(3).select('HH:mm:ss.SSS');
cy.wait(delay);
cy.get('.euiButton__text').contains('Update').click({ force: true });
cy.wait(delay);
cy.contains('12:59:07.303').should('exist');
cy.wait(1000);
cy.get('.xtick')
.eq(0)
.invoke('text')
.then((text) => {
expect(moment(text, 'HH:mm:ss.SSS').format('HH:mm:ss.SSS')).equal(text);
});

cy.get('select').eq(3).select('MM/DD HH:mm:ss');
cy.wait(delay);
cy.get('.euiButton__text').contains('Update').click({ force: true });
cy.wait(delay);
cy.contains('05/28 12:59:07').should('exist');
cy.wait(1000);
cy.get('.xtick')
.eq(0)
.invoke('text')
.then((text) => {
expect(moment(text, 'MM/DD HH:mm:ss').format('MM/DD HH:mm:ss')).equal(
text
);
});

cy.get('select').eq(3).select('MM/DD/YY HH:mm');
cy.wait(delay);
cy.get('.euiButton__text').contains('Update').click({ force: true });
cy.wait(delay);
cy.contains('05/28/20 12:59').should('exist');
cy.wait(1000);
cy.get('.xtick')
.eq(0)
.invoke('text')
.then((text) => {
expect(moment(text, 'MM/DD/YY HH:mm').format('MM/DD/YY HH:mm')).equal(
text
);
});
});

it('Hides legends', () => {
Expand Down

0 comments on commit 4c47dcb

Please sign in to comment.