-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from dhis2/Upstream_changes_widgets
Upstream changes widgets
- Loading branch information
Showing
22 changed files
with
661 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"applicationTitle": "Foobar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
229 changes: 229 additions & 0 deletions
229
cypress/fixtures/HeaderBar/getModulesWithSpecialChars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
{ | ||
"modules": [ | ||
{ | ||
"name": "/", | ||
"namespace": "//", | ||
"defaultAction": "..//.action", | ||
"displayName": "A / character", | ||
"icon": "../icons/dhis-web-dashboard.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "-", | ||
"namespace": "/-", | ||
"defaultAction": "../-.action", | ||
"displayName": "A - character", | ||
"icon": "../icons/dhis-web-dashboard.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "(", | ||
"namespace": "/(", | ||
"defaultAction": "../(.action", | ||
"displayName": "A ( character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": ")", | ||
"namespace": "/)", | ||
"defaultAction": "../).action", | ||
"displayName": "A ) character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "[", | ||
"namespace": "/[", | ||
"defaultAction": "../[.action", | ||
"displayName": "A [ character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "]", | ||
"namespace": "/]", | ||
"defaultAction": "../].action", | ||
"displayName": "A ] character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "{", | ||
"namespace": "/{", | ||
"defaultAction": "../{.action", | ||
"displayName": "A { character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "}", | ||
"namespace": "/}", | ||
"defaultAction": "../}.action", | ||
"displayName": "A } character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "*", | ||
"namespace": "/*", | ||
"defaultAction": "../*.action", | ||
"displayName": "A * character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "+", | ||
"namespace": "/+", | ||
"defaultAction": "../+.action", | ||
"displayName": "A + character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "?", | ||
"namespace": "/?", | ||
"defaultAction": "../?.action", | ||
"displayName": "A ? character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": ".", | ||
"namespace": "/.", | ||
"defaultAction": "../..action", | ||
"displayName": "A . character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": ",", | ||
"namespace": "/,", | ||
"defaultAction": "../,.action", | ||
"displayName": "A , character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "^", | ||
"namespace": "/^", | ||
"defaultAction": "../^.action", | ||
"displayName": "A ^ character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "$", | ||
"namespace": "/$", | ||
"defaultAction": "../$.action", | ||
"displayName": "A $ character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "|", | ||
"namespace": "/|", | ||
"defaultAction": "../|.action", | ||
"displayName": "A | character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "#", | ||
"namespace": "/#", | ||
"defaultAction": "../#.action", | ||
"displayName": "A # character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "\\s", | ||
"namespace": "/\\s", | ||
"defaultAction": "../\\s.action", | ||
"displayName": "A \\s character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "\\", | ||
"namespace": "/\\", | ||
"defaultAction": "../\\.action", | ||
"displayName": "A \\ character", | ||
"icon": "../icons/dhis-web-data-visualizer.png", | ||
"description": "" | ||
}, | ||
|
||
{ | ||
"name": "dhis-web-dashboard", | ||
"namespace": "/dhis-web-dashboard", | ||
"defaultAction": "../dhis-web-dashboard/index.action", | ||
"displayName": "Dashboard", | ||
"icon": "../icons/dhis-web-dashboard.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-capture", | ||
"namespace": "/dhis-web-capture", | ||
"defaultAction": "../dhis-web-capture/index.action", | ||
"displayName": "Capture", | ||
"icon": "../icons/dhis-web-capture.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-maintenance", | ||
"namespace": "/dhis-web-maintenance", | ||
"defaultAction": "../dhis-web-maintenance/index.action", | ||
"displayName": "Maintenance", | ||
"icon": "../icons/dhis-web-maintenance.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-maps", | ||
"namespace": "/dhis-web-maps", | ||
"defaultAction": "../dhis-web-maps/index.action", | ||
"displayName": "Maps", | ||
"icon": "../icons/dhis-web-maps.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-event-reports", | ||
"namespace": "/dhis-web-event-reports", | ||
"defaultAction": "../dhis-web-event-reports/index.action", | ||
"displayName": "Event Reports", | ||
"icon": "../icons/dhis-web-event-reports.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-interpretation", | ||
"namespace": "/dhis-web-interpretation", | ||
"defaultAction": "../dhis-web-interpretation/index.action", | ||
"displayName": "Interpretations", | ||
"icon": "../icons/dhis-web-interpretation.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "dhis-web-import-export", | ||
"namespace": "/dhis-web-import-export", | ||
"defaultAction": "../dhis-web-import-export/index.action", | ||
"displayName": "Import/Export", | ||
"icon": "../icons/dhis-web-importexport.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "WHO Metadata browser", | ||
"namespace": "WHO Metadata browser", | ||
"defaultAction": "https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/index.html", | ||
"displayName": "", | ||
"icon": "https://debug.dhis2.org/dev/api/apps/WHO-Metadata-browser/icons/medicine-48.png", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "Dashboard Classic", | ||
"namespace": "Dashboard Classic", | ||
"defaultAction": "https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/index.html", | ||
"displayName": "", | ||
"icon": "https://debug.dhis2.org/dev/api/apps/Dashboard-Classic/icon.png", | ||
"description": "DHIS2 Legacy Dashboard App" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
import { Before, Given } from 'cypress-cucumber-preprocessor/steps' | ||
|
||
export const baseUrl = 'https://domain.tld/' | ||
export const webCommons = 'https://domain.tld/dhis-web-commons/' | ||
|
||
Before(() => { | ||
cy.fixture('HeaderBar/systemInfo').as('systemInfoFixture') | ||
cy.fixture('HeaderBar/applicationTitle').as('applicationTitleFixture') | ||
cy.fixture('HeaderBar/me').as('meFixture') | ||
cy.fixture('HeaderBar/getModules').as('modulesFixture') | ||
cy.fixture('HeaderBar/dashboard').as('dashboardFixture') | ||
cy.fixture('HeaderBar/logo_banner').as('logoFixture') | ||
}) | ||
|
||
Given('the HeaderBar loads without an error', () => { | ||
cy.server() | ||
|
||
cy.get('@systemInfoFixture').then(fx => { | ||
cy.get('@applicationTitleFixture').then(fx => { | ||
cy.route({ | ||
url: 'https://domain.tld/api/system/info', | ||
url: `${baseUrl}/api/systemSettings/applicationTitle`, | ||
response: fx, | ||
}).as('systemInfo') | ||
}).as('applicationTitle') | ||
}) | ||
|
||
cy.get('@meFixture').then(fx => { | ||
cy.route({ | ||
url: 'https://domain.tld/api/me', | ||
url: `${baseUrl}/api/me`, | ||
response: fx, | ||
}).as('systemInfo') | ||
}).as('me') | ||
}) | ||
|
||
cy.get('@modulesFixture').then(fx => { | ||
cy.route({ | ||
url: 'https://domain.tld/dhis-web-commons/menu/getModules.action', | ||
url: `${baseUrl}/dhis-web-commons/menu/getModules.action`, | ||
response: fx, | ||
}).as('modules') | ||
}) | ||
|
||
cy.get('@dashboardFixture').then(fx => { | ||
cy.route({ | ||
url: 'https://domain.tld/api/me/dashboard', | ||
url: `${baseUrl}/api/me/dashboard`, | ||
response: fx, | ||
}).as('dashboard') | ||
}) | ||
|
||
cy.get('@logoFixture').then(fx => { | ||
cy.route({ | ||
url: 'https://domain.tld/api/staticContent/logo_banner', | ||
url: `${baseUrl}/api/staticContent/logo_banner`, | ||
response: fx, | ||
}).as('logo_banner') | ||
}) | ||
}) | ||
|
||
Given('the HeaderBar loads without an error', () => { | ||
cy.visitStory('HeaderBarTesting', 'Default') | ||
}) |
17 changes: 10 additions & 7 deletions
17
.../the_headerbar_contains_a_menu_to_all_apps/the_user_will_be_offered_a_menu_with_5_apps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
...the_headerbar_should_contain_a_logo_that_links_to_the_homepage/headerbar_contains_logo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import '../common/index.js' | ||
import { Then } from 'cypress-cucumber-preprocessor/steps' | ||
import { baseUrl } from '../common/index.js' | ||
|
||
Then('the HeaderBar should display the dhis2 logo', () => { | ||
cy.get('[data-test="headerbar-logo"]').should('be.visible') | ||
}) | ||
|
||
Then('the logo should link to the homepage', () => { | ||
cy.getAll('@systemInfoFixture', '[data-test="headerbar-logo"] a').should( | ||
([{ contextPath }, $a]) => { | ||
expect($a.attr('href')).to.equal(contextPath) | ||
} | ||
) | ||
cy.get('[data-test="headerbar-logo"] a').should($a => { | ||
expect($a.attr('href')).to.equal(baseUrl) | ||
}) | ||
}) |
16 changes: 8 additions & 8 deletions
16
..._the_title_provided_by_the_backend_and_the_app/the_headerbar_displays_the_custom_title.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.