diff --git a/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.html b/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.html index 0b6de29eaa..27ec604396 100644 --- a/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.html +++ b/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.html @@ -15,7 +15,7 @@ : 'ibf-no-alert-tertiary' }}" fill="solid" - data-test="time-line-button" + data-test="timeline-button" [class.active]="timeStepButton.active" [class.alert]="timeStepButton.alert && !timeStepButton?.disabled" (click)="handleTimeStepButtonClick(timeStepButton.value)" diff --git a/tests/cypress/integration/IBF-dashboard/timeline-component.spec.js b/tests/cypress/integration/IBF-dashboard/timeline-component.spec.js index 3a8bd115d5..aa4db935b5 100644 --- a/tests/cypress/integration/IBF-dashboard/timeline-component.spec.js +++ b/tests/cypress/integration/IBF-dashboard/timeline-component.spec.js @@ -1,19 +1,24 @@ import selectors from '../../support/selectors'; -// timeline validation -describe('timeline validation', () => { +describe('timeline component', () => { beforeEach(() => { cy.login(); }); - it('load and validate timeLineButton', () => { - cy.get(selectors.timelineButton) - .should('be.visible') - .should('not.be.disabled'); + it('should load at least 1 timeline button', () => { + cy.get(selectors.timeline.timelineButton).should('be.visible'); }); + it('should load at least 1 active timeline button', () => { + cy.get(selectors.timeline.timelineButtonActive).should('be.visible'); + }); + + it('should load at least 1 triggered button IF dashboard in triggered state'); + + it('should load 0 triggered button IF dashboard in non-triggered state'); + it('click on active timeline button', () => { - cy.get(selectors.timelineButtonActive).as('Activebutton'); + cy.get(selectors.timeline.timelineButtonActive).as('Activebutton'); cy.get('@Activebutton').then(($button) => { cy.wrap($button).should('be.visible').should('not.be.disabled').click(); }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 2278e02c0a..c8cdf1a967 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -67,6 +67,7 @@ Cypress.Commands.add('waitForAngular', () => { }); }); }); + /* check trigger*/ Cypress.Commands.add('isStatusTriggered', () => { cy.get(selectors.triggerActiveTrue); diff --git a/tests/cypress/support/selectors.js b/tests/cypress/support/selectors.js index dff7d04092..3e95cdab81 100644 --- a/tests/cypress/support/selectors.js +++ b/tests/cypress/support/selectors.js @@ -1,4 +1,8 @@ export default { + timeline: { + timelineButton: '[data-test=timeline-button]', + timelineButtonActive: '[data-test=timeline-button].active', + }, pageTitle: "[data-test='page-title']", inputUser: "[data-test='input-user'] input", inputPassword: "[data-test='input-password'] input", @@ -12,14 +16,10 @@ export default { loader: "[data-test='loader']", videoGuidebutton: '[data-test=video-guide-button]', videoGuideclosebutton: '[data-test=video-popover] .icon-large', - timelineButton: '[data-test=time-line-button]', - timelineButtonActive: '[data-test=time-line-button].active', aggregateList: '[data-test=aggregate-list]', aggregateNumber: '[data-test=aggregate-number]', ExposedaggregateNumber: ':nth-child(1)>>>[data-test=aggregate-number]', TotalaggregateNumber: ':nth-child(2)>>>[data-test=aggregate-number]', - CattleExposedNumber: ':nth-child(4)>>>[data-test=aggregate-number]', - SamllRuminantNumber: ':nth-child(5)>>>[data-test=aggregate-number]', AggregatePopupicon: ':nth-child(1)>>[data-test=icon-row]', disastertypes: '[data-test=disaster-Type]', disasterlabel: '[data-test=disaster-labelname]',