Skip to content

Commit

Permalink
Merge branch 'v38' into backport/repetitions-in-ll-plugin-v38
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen authored Apr 9, 2024
2 parents e705ba2 + 69e8167 commit bac9f6a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/common/view/add_a_FILTERTYPE_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When('I add a {string} filter', dimensionType => {
// select an item in the modal
if (dimensionType === 'Period') {
cy.get(unselectedItemsSel).contains(PERIOD).dblclick()
} else if (dimensionType === 'Organisation Unit') {
} else if (dimensionType === 'Organisation unit') {
cy.get(orgUnitTreeSel, EXTENDED_TIMEOUT)
.find('[type="checkbox"]', EXTENDED_TIMEOUT)
.check(OU_ID)
Expand Down
9 changes: 5 additions & 4 deletions cypress/integration/edit/edit_dashboard/show_description.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { clickViewActionButton } from '../../../elements/viewDashboard'
import { getApiBaseUrl } from '../../../support/server/utils'

const SHOW_DESC_RESP_CODE_SUCCESS = 201
const RESP_CODE_200 = 200
const RESP_CODE_201 = 201
const SHOW_DESC_RESP_CODE_FAIL = 409

before(() => {
Expand All @@ -15,7 +16,7 @@ before(() => {
},
body: 'false',
}).then(response =>
expect(response.status).to.equal(SHOW_DESC_RESP_CODE_SUCCESS)
expect(response.status).to.be.oneOf([RESP_CODE_201, RESP_CODE_200])
)
})

Expand All @@ -29,7 +30,7 @@ When('I click to show description', () => {

cy.wait('@toggleDescription')
.its('response.statusCode')
.should('eq', SHOW_DESC_RESP_CODE_SUCCESS)
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

When('I click to hide the description', () => {
Expand All @@ -38,7 +39,7 @@ When('I click to hide the description', () => {

cy.wait('@toggleDescription')
.its('response.statusCode')
.should('eq', SHOW_DESC_RESP_CODE_SUCCESS)
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

// Error scenario
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/edit/filter_restrict.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Feature: Editing Filter Restrictions
Then Filter Restrictions are not restricted

@nonmutating
Scenario: I see Period and Organisation Unit if newly choosing to restrict dimensions
Scenario: I see Period and Organisation unit if newly choosing to restrict dimensions
Given I open an existing dashboard with non-restricted Filter settings in edit mode
And I click on Filter settings
And I click to restrict Filter settings
Then Period and Organisation Unit are displayed as selected by default
Then Period and Organisation unit are displayed as selected by default

@nonmutating
Scenario: I change Filter Restrictions and the changes persist while editing Filter settings
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/edit/filter_restrict/filter_restrict.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ Then('Filter Restrictions are not restricted', () => {
})

/*
Scenario: I see Period and Organisation Unit if newly choosing to restrict dimensions
Scenario: I see Period and Organisation unit if newly choosing to restrict dimensions
*/

Then(
'Period and Organisation Unit are displayed as selected by default',
'Period and Organisation unit are displayed as selected by default',
() => {
cy.get('[data-test="dhis2-uicore-transfer-rightside"]')
.contains('Period')
.should('be.visible')
cy.get('[data-test="dhis2-uicore-transfer-rightside"]')
.contains('Organisation Unit')
.contains('Organisation unit')
.should('be.visible')
}
)
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/view/dashboard_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Feature: Dashboard filter
When I add a "Period" filter
Then the Period filter is applied to the dashboard

Scenario: I add a Organisation Unit filter
Scenario: I add a Organisation unit filter
Given I open existing dashboard
Then the dashboard displays in view mode
When I add a "Organisation Unit" filter
Then the Organisation Unit filter is applied to the dashboard
When I add a "Organisation unit" filter
Then the Organisation unit filter is applied to the dashboard

Scenario: I add a Facility Type filter
Given I open existing dashboard
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/view/dashboard_filter/dashboard_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ Then('the Period filter is applied to the dashboard', () => {
})

/*
Scenario: I add an Organisation Unit filter
Scenario: I add an Organisation init filter
*/

Then('the Organisation Unit filter is applied to the dashboard', () => {
Then('the Organisation unit filter is applied to the dashboard', () => {
cy.get(filterBadgeSel)
.contains(`Organisation Unit: ${OU}`)
.contains(`Organisation unit: ${OU}`)
.should('be.visible')

cy.get(innerScrollContainerSel).scrollTo('bottom')
Expand Down
15 changes: 12 additions & 3 deletions cypress/integration/view/view_dashboard/resize_dashboards_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
} from '../../../elements/viewDashboard'
import { EXTENDED_TIMEOUT } from '../../../support/utils'

const RESP_CODE_200 = 200
const RESP_CODE_201 = 201

// Scenario: I change the height of the control bar
When('I drag to increase the height of the control bar', () => {
cy.intercept('PUT', '/userDataStore/dashboard/controlBarRows').as('putRows')
Expand All @@ -13,7 +16,9 @@ When('I drag to increase the height of the control bar', () => {
.trigger('mousemove', { clientY: 300 })
.trigger('mouseup')

cy.wait('@putRows').its('response.statusCode').should('eq', 201)
cy.wait('@putRows')
.its('response.statusCode')
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

Then('the control bar height should be updated', () => {
Expand All @@ -27,7 +32,9 @@ Then('the control bar height should be updated', () => {
.trigger('mousedown')
.trigger('mousemove', { clientY: 71 })
.trigger('mouseup')
cy.wait('@putRows').its('response.statusCode').should('eq', 201)
cy.wait('@putRows')
.its('response.statusCode')
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

When('I drag to decrease the height of the control bar', () => {
Expand All @@ -37,5 +44,7 @@ When('I drag to decrease the height of the control bar', () => {
.trigger('mousemove', { clientY: 300 })
.trigger('mouseup')

cy.wait('@putRows').its('response.statusCode').should('eq', 201)
cy.wait('@putRows')
.its('response.statusCode')
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ beforeEach(() => {
'content-type': 'application/json',
},
body: '1',
}).then(response => expect(response.status).to.equal(201))
}).then(response => expect(response.status).to.be.oneOf([200, 201]))
})

When('I toggle show more dashboards', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ before(() => {
'content-type': 'application/json',
},
body: 'false',
}).then(response => expect(response.status).to.equal(201))
}).then(response => expect(response.status).to.be.oneOf([200, 201]))
})

When('clicking to show description fails', () => {
Expand Down

0 comments on commit bac9f6a

Please sign in to comment.