Skip to content

Commit

Permalink
Merge branch 'dev' into ee-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
turban committed Dec 20, 2023
2 parents e7e3c47 + f7b1e9b commit 8334c9c
Show file tree
Hide file tree
Showing 7 changed files with 537 additions and 527 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ jobs:
REPORTPORTAL_API_KEY: ${{ secrets.REPORTPORTAL_API_KEY }}
REPORTPORTAL_ENDPOINT: ${{ vars.REPORTPORTAL_ENDPOINT }}
REPORTPORTAL_PROJECT: ${{ vars.REPORTPORTAL_PROJECT }}
CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PR_TITLE: ${{ github.event.pull_request.title }}

call-workflow-e2e-prod:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = defineConfig({
},
{
key: 'app_name',
value: 'maps_app',
value: 'maps-app',
},
{
key: 'test_level',
Expand Down
69 changes: 44 additions & 25 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
const reportPortalConfig = [
'@reportportal/agent-js-jest',
{
apiKey: process.env.REPORTPORTAL_API_KEY,
endpoint: process.env.REPORTPORTAL_ENDPOINT,
project: process.env.REPORTPORTAL_PROJECT,
launch: 'maps_app',
attributes: [
{
key: 'dhis2_version',
value: 'master',
},
{
key: 'app_name',
value: 'maps-app',
},
{
key: 'test_level',
value: 'unit/integration',
},
{
key: 'BRANCH_NAME',
value: process.env.BRANCH_NAME,
},
{
key: 'CI_BUILD_ID',
value: process.env.CI_BUILD_ID,
},
{
key: 'PR_TITLE',
value: process.env.PR_TITLE,
},
],
description: '',
debug: true,
},
]

const isReportPortalSetup =
process.env.REPORTPORTAL_API_KEY !== undefined &&
process.env.REPORTPORTAL_ENDPOINT !== undefined &&
process.env.REPORTPORTAL_PROJECT !== undefined

module.exports = {
setupFilesAfterEnv: ['<rootDir>/config/testSetup.js'],
collectCoverageFrom: ['src/**/*.js'],
Expand All @@ -14,30 +57,6 @@ module.exports = {
testRunner: 'jest-circus/runner',
reporters: [
'default',
[
'@reportportal/agent-js-jest',
{
apiKey: process.env.REPORTPORTAL_API_KEY,
endpoint: process.env.REPORTPORTAL_ENDPOINT,
project: process.env.REPORTPORTAL_PROJECT,
launch: 'maps_app',
attributes: [
{
key: 'version',
value: 'master',
},
{
key: 'app_name',
value: 'maps_app',
},
{
key: 'test_level',
value: 'unit/integration',
},
],
description: '',
debug: true,
},
],
...(isReportPortalSetup ? [reportPortalConfig] : []),
],
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"postinstall": "patch-package"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^10.3.10",
"@dhis2/cli-app-scripts": "^10.3.11",
"@dhis2/cli-style": "^10.5.1",
"@dhis2/cypress-commands": "^10.0.3",
"@dhis2/cypress-plugins": "^10.0.3",
Expand All @@ -39,14 +39,14 @@
"start-server-and-test": "^2.0.1"
},
"dependencies": {
"@dhis2/analytics": "^26.0.17",
"@dhis2/analytics": "^26.2.0",
"@dhis2/app-runtime": "^3.9.4",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/app-service-alerts": "^3.9.4",
"@dhis2/app-service-datastore": "^1.0.0-beta.3",
"@dhis2/d2-i18n": "^1.1.1",
"@dhis2/maps-gl": "^3.8.6",
"@dhis2/ui": "^8.13.15",
"@dhis2/ui": "^8.16.0",
"@krakenjs/post-robot": "^11.0.0",
"@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop",
"@reportportal/agent-js-jest": "^5.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@ import { render } from '@testing-library/react'
import React from 'react'
import DataDownloadDialogActions from '../DataDownloadDialogActions.js'

/* eslint-disable react/prop-types */
jest.mock('@dhis2/ui', () => {
const originalModule = jest.requireActual('@dhis2/ui')

return {
__esModule: true,
...originalModule,
Button: function Mock({ children }) {
return <div className="ui-Button">{children}</div>
},
ButtonStrip: function Mock({ children }) {
return <div className="ui-ButtonStrip">{children}</div>
},
CircularLoader: function Mock({ children }) {
return <div className="ui-CircularLoader">{children}</div>
},
}
})
/* eslint-enable react/prop-types */

describe('DataDownloadDialogActions', () => {
it('Should render two buttons and NO loading spinner', () => {
it('Should render two buttons and NO loading spinner when not loading', () => {
const { container } = render(
<DataDownloadDialogActions
downloading={false}
Expand All @@ -14,7 +34,7 @@ describe('DataDownloadDialogActions', () => {
expect(container).toMatchSnapshot()
})

it('Should disable buttons and show loading spinner when loading', () => {
it('Should render two buttons and show loading spinner when loading', () => {
const { container } = render(
<DataDownloadDialogActions
downloading={true}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,73 +1,41 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DataDownloadDialogActions Should disable buttons and show loading spinner when loading 1`] = `
exports[`DataDownloadDialogActions Should render two buttons and NO loading spinner when not loading 1`] = `
<div>
<div
class="jsx-1994200789 end"
data-test="dhis2-uicore-buttonstrip"
class="ui-ButtonStrip"
>
<div
class="jsx-1994200789 box"
class="ui-Button"
>
<button
class="jsx-441677069 secondary"
data-test="dhis2-uicore-button"
disabled=""
type="button"
>
Cancel
</button>
Cancel
</div>
<div
class="jsx-1994200789 box"
class="ui-Button"
>
<button
class="jsx-441677069 primary"
data-test="dhis2-uicore-button"
disabled=""
name="download-button"
type="button"
>
Download
<div
class="jsx-1838964138 btnProgress small"
data-test="dhis2-uicore-circularloader"
role="progressbar"
/>
</button>
Download
</div>
</div>
</div>
`;

exports[`DataDownloadDialogActions Should render two buttons and NO loading spinner 1`] = `
exports[`DataDownloadDialogActions Should render two buttons and show loading spinner when loading 1`] = `
<div>
<div
class="jsx-1994200789 end"
data-test="dhis2-uicore-buttonstrip"
class="ui-ButtonStrip"
>
<div
class="jsx-1994200789 box"
class="ui-Button"
>
<button
class="jsx-441677069 secondary"
data-test="dhis2-uicore-button"
type="button"
>
Cancel
</button>
Cancel
</div>
<div
class="jsx-1994200789 box"
class="ui-Button"
>
<button
class="jsx-441677069 primary"
data-test="dhis2-uicore-button"
name="download-button"
type="button"
>
Download
</button>
Download
<div
class="ui-CircularLoader"
/>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 8334c9c

Please sign in to comment.