Skip to content

Commit b7d1abb

Browse files
Merge branch 'feat/header-bar-design-ui-update' of github.com:dhis2/dashboard-app into feat/header-bar-design-ui-update
2 parents 0cfded6 + d501076 commit b7d1abb

38 files changed

+223
-222
lines changed

cypress/e2e/common/click_on_the_FILTERTYPE_filter_badge.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ import { When } from '@badeball/cypress-cucumber-preprocessor'
22
import { filterBadgeSel } from '../../elements/dashboardFilter.js'
33

44
When('I click on the {string} filter badge', (filterName) => {
5-
cy.get(filterBadgeSel).find('button').contains(filterName).click()
5+
cy.get(filterBadgeSel)
6+
.find('button')
7+
.contains(filterName)
8+
.click({ force: true })
69
})
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { When } from '@badeball/cypress-cucumber-preprocessor'
2-
import { clickViewActionButton } from '../../elements/viewDashboard.js'
32

43
When('I click to preview the print layout', () => {
5-
clickViewActionButton('More')
4+
cy.get('[data-test="more-actions-button"]').click()
65
cy.get('[data-test="print-menu-item"]').click()
76
cy.get('[data-test="print-layout-menu-item"]').click()
87
})

cypress/e2e/common/open_the_SL_dashboard.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { Given } from '@badeball/cypress-cucumber-preprocessor'
22
import { dashboards } from '../../assets/backends/index.js'
33
// import { gridItemSel, chartSel } from '../../elements/dashboardItem.js'
4-
import {
5-
dashboardTitleSel,
6-
dashboardChipSel,
7-
} from '../../elements/viewDashboard.js'
8-
import { EXTENDED_TIMEOUT } from '../../support/utils.js'
4+
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
5+
import { dashboardTitleSel } from '../../elements/viewDashboard.js'
96

107
Given('I open the {string} dashboard', (title) => {
11-
cy.get(dashboardChipSel, EXTENDED_TIMEOUT).contains(title).click()
8+
getNavigationMenuItem(title).click()
129

1310
cy.location().should((loc) => {
1411
expect(loc.hash).to.equal(dashboards[title].route)

cypress/e2e/dashboard_filter/create_dashboard.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
22
import { gridItemSel } from '../../elements/dashboardItem.js'
3-
import {
4-
dashboardsNavMenuButtonSel,
5-
dashboardTitleSel,
6-
} from '../../elements/viewDashboard.js'
3+
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
4+
import { dashboardTitleSel } from '../../elements/viewDashboard.js'
75
import {
86
EXTENDED_TIMEOUT,
97
createDashboardTitle,
@@ -79,8 +77,7 @@ When('I add items and save', () => {
7977
})
8078

8179
Given('I open an existing dashboard', () => {
82-
cy.get(dashboardsNavMenuButtonSel, EXTENDED_TIMEOUT).click()
83-
cy.get('[role="menu"]').find('li').contains(TEST_DASHBOARD_TITLE).click()
80+
getNavigationMenuItem(TEST_DASHBOARD_TITLE).click()
8481
})
8582

8683
// Some map visualization load very slowly:

cypress/e2e/dashboard_filter/dashboard_filter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Scenario: I add a Period filter
2323
*/
2424

2525
Then('the Period filter is applied to the dashboard', () => {
26-
console.log('HENKIE!!!!!!!!!!')
2726
cy.get(filterBadgeSel).contains(`Period: ${PERIOD}`).should('be.visible')
2827

2928
// check the CHART

cypress/e2e/edit_dashboard/edit_dashboard.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import {
99
titleInputSel,
1010
clickEditActionButton,
1111
} from '../../elements/editDashboard.js'
12+
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
1213
import {
13-
dashboardChipSel,
1414
dashboardTitleSel,
15+
dashboardsNavMenuButtonSel,
1516
} from '../../elements/viewDashboard.js'
1617
import { EXTENDED_TIMEOUT, createDashboardTitle } from '../../support/utils.js'
1718

@@ -79,9 +80,8 @@ Then('different valid dashboard displays in view mode', () => {
7980
})
8081

8182
Given('I open existing dashboard', () => {
82-
cy.get(dashboardChipSel, EXTENDED_TIMEOUT)
83-
.contains(TEST_DASHBOARD_TITLE)
84-
.click()
83+
cy.get(dashboardsNavMenuButtonSel, EXTENDED_TIMEOUT).click()
84+
cy.get('[role="menu"]').find('li').contains(TEST_DASHBOARD_TITLE).click()
8585

8686
cy.location().should((loc) => {
8787
const currentRoute = getRouteFromHash(loc.hash)
@@ -124,8 +124,7 @@ Scenario: I delete a dashboard
124124
*/
125125

126126
Then('the dashboard is deleted and first starred dashboard displayed', () => {
127-
cy.get(dashboardChipSel).contains(TEST_DASHBOARD_TITLE).should('not.exist')
128-
127+
getNavigationMenuItem(TEST_DASHBOARD_TITLE).should('not.exist')
129128
cy.get(dashboardTitleSel).should('exist').should('not.be.empty')
130129
})
131130

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
22
import {
3-
starSel,
3+
getNavigationMenuItem,
4+
closeNavigationMenu,
5+
} from '../../elements/navigationMenu.js'
6+
import {
47
dashboardStarredSel,
58
dashboardUnstarredSel,
6-
dashboardChipSel,
7-
chipStarSel,
9+
navMenuItemStarIconSel,
810
} from '../../elements/viewDashboard.js'
911
import { TEST_DASHBOARD_TITLE } from './edit_dashboard.js'
1012

1113
// Scenario: I star the dashboard
1214
When('I click to star the dashboard', () => {
1315
cy.intercept('POST', '**/favorite').as('starDashboard')
1416

15-
cy.get(starSel).click()
17+
cy.get(dashboardUnstarredSel).click()
1618
cy.wait('@starDashboard').its('response.statusCode').should('eq', 200)
1719
})
1820

1921
When('I click to unstar the dashboard', () => {
2022
cy.intercept('DELETE', '**/favorite').as('unstarDashboard')
2123

22-
cy.get(starSel).click()
24+
cy.get(dashboardStarredSel).click()
2325
cy.wait('@unstarDashboard').its('response.statusCode').should('eq', 200)
2426
})
2527

@@ -28,22 +30,21 @@ Then('the dashboard is starred', () => {
2830
cy.get(dashboardStarredSel).should('be.visible')
2931
cy.get(dashboardUnstarredSel).should('not.exist')
3032

31-
cy.get(dashboardChipSel)
32-
.contains(TEST_DASHBOARD_TITLE)
33-
.parent()
34-
.siblings(chipStarSel)
35-
.first()
33+
getNavigationMenuItem(TEST_DASHBOARD_TITLE)
34+
.find(navMenuItemStarIconSel)
3635
.should('be.visible')
36+
37+
closeNavigationMenu()
3738
})
3839

3940
Then('the dashboard is not starred', () => {
4041
// check for the unfilled star next to the title
4142
cy.get(dashboardUnstarredSel).should('be.visible')
4243
cy.get(dashboardStarredSel).should('not.exist')
4344

44-
cy.get(dashboardChipSel)
45-
.contains(TEST_DASHBOARD_TITLE)
46-
.parent()
47-
.siblings()
45+
getNavigationMenuItem(TEST_DASHBOARD_TITLE)
46+
.find(navMenuItemStarIconSel)
4847
.should('not.exist')
48+
49+
closeNavigationMenu()
4950
})

cypress/e2e/filter_restrict/filter_restrict.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ When('I save the dashboard', () => {
146146
})
147147

148148
When('I click Add Filter', () => {
149-
clickViewActionButton('Add filter')
149+
clickViewActionButton('Filter')
150150
})
151151

152152
Then('I see Facility Ownership and no other dimensions', () => {
@@ -168,7 +168,7 @@ Scenario: I restrict filters to no dimensions and do not see Add Filter in dashb
168168
*/
169169

170170
Then('Add Filter button is not visible', () => {
171-
cy.contains('Add filter').should('not.exist')
171+
cy.contains('Filter').should('not.exist')
172172
})
173173

174174
When('I delete the dashboard', () => {

cypress/e2e/offline/offline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Then(
212212
// edit, sharing, starring, filtering, all options under more
213213
getViewActionButton('Edit').should('be.disabled')
214214
getViewActionButton('Share').should('be.disabled')
215-
getViewActionButton('Add filter').should('be.disabled')
215+
getViewActionButton('Filter').should('be.disabled')
216216
getViewActionButton('More').should('be.enabled')
217217

218218
checkCorrectMoreOptionsEnabledState(false, cacheState)

cypress/e2e/responsive_dashboard/responsive_dashboard.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ Then('the small screen view is shown', () => {
2727
//titlebar - only the More button and the title
2828
cy.get('button').contains('Edit').should('not.be.visible')
2929
cy.get('button').contains('Share').should('not.be.visible')
30-
cy.get('button').contains('Add filter').should('not.be.visible')
31-
32-
cy.get('button.small').contains('More').should('be.visible')
33-
cy.get('button').not('.small').contains('More').should('not.be.visible')
30+
cy.get('button').contains('Filter').should('not.be.visible')
3431
})
3532

3633
When('I restore the wide screen', () => {
@@ -44,10 +41,7 @@ Then('the wide screen view is shown', () => {
4441

4542
cy.get('button').contains('Edit').should('be.visible')
4643
cy.get('button').contains('Share').should('be.visible')
47-
cy.get('button').contains('Add filter').should('be.visible')
48-
49-
cy.get('button').not('.small').contains('More').should('be.visible')
50-
cy.get('button.small').contains('More').should('not.be.visible')
44+
cy.get('button').contains('Filter').should('be.visible')
5145
})
5246

5347
Then('the small screen edit view is shown', () => {

0 commit comments

Comments
 (0)