Skip to content

Commit

Permalink
Merge branch 'dev' into chip-design
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott authored Dec 15, 2023
2 parents 1dd2b86 + 4f3669d commit f57b00f
Show file tree
Hide file tree
Showing 42 changed files with 692 additions and 127 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# [100.4.0](https://github.com/dhis2/data-visualizer-app/compare/v100.3.1...v100.4.0) (2023-12-14)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([65441f2](https://github.com/dhis2/data-visualizer-app/commit/65441f2b454a6e0f74567b8b7107cad63d594a04))
* **translations:** sync translations from transifex (dev) ([005be59](https://github.com/dhis2/data-visualizer-app/commit/005be599f7dd4382f0086861d74064aedc49ac29))


### Features

* cumulative values in PT (DHIS2-5497) ([#2746](https://github.com/dhis2/data-visualizer-app/issues/2746)) ([bff69ab](https://github.com/dhis2/data-visualizer-app/commit/bff69ab9cec7685adad823197de8508e9ae83636)), closes [#1946](https://github.com/dhis2/data-visualizer-app/issues/1946)

## [100.3.1](https://github.com/dhis2/data-visualizer-app/compare/v100.3.0...v100.3.1) (2023-11-08)


Expand Down
9 changes: 8 additions & 1 deletion cypress/elements/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ const loadingEl = 'dhis2-uicore-circularloader'
export const expectAppToNotBeLoading = () =>
cy.getBySel(loadingEl, { timeout: 15000 }).should('not.exist')

export const clickCheckbox = (target) =>
export const checkCheckbox = (target) =>
cy.getBySel(target).click().find('[type="checkbox"]').should('be.checked')

export const uncheckCheckbox = (target) =>
cy
.getBySel(target)
.click()
.find('[type="checkbox"]')
.should('not.be.checked')

export const typeInput = (target, text) =>
cy.getBySel(target).find('input').type(text)

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ export {
} from './axes.js'

export {
clickTrendLineCheckbox,
checkTrendLineCheckbox,
selectTrendLineType,
clickTargetLineCheckbox,
checkTargetLineCheckbox,
setTargetLineValue,
setTargetLineLabel,
clickBaseLineCheckbox,
checkBaseLineCheckbox,
setBaseLineLabel,
setBaseLineValue,
} from './lines.js'

export { setCustomSubtitle } from './subtitle.js'

export { clickOutliersCheckbox } from './outliers.js'
export { checkOutliersCheckbox } from './outliers.js'

export { setItemToAxis, setItemToType } from './series.js'

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/lines.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clickCheckbox, typeInput } from '../common.js'
import { checkCheckbox, typeInput } from '../common.js'

const trendLineCheckboxEl = 'option-trend-line-checkbox'
const trendLineSelectEl = 'option-trend-line-select'
Expand All @@ -10,22 +10,22 @@ const baseLineCheckboxEl = 'option-base-line-checkbox'
const baseLineValueInputEl = 'option-base-line-value-input'
const baseLineLabelInputEl = 'option-base-line-label-input'

export const clickTrendLineCheckbox = () => clickCheckbox(trendLineCheckboxEl)
export const checkTrendLineCheckbox = () => checkCheckbox(trendLineCheckboxEl)

export const selectTrendLineType = (optionName) => {
cy.getBySel(trendLineSelectEl).findBySel('dhis2-uicore-select').click()
cy.getBySel(trendLineSelectOptionEl).contains(optionName).click()
}

export const clickTargetLineCheckbox = () => clickCheckbox(targetLineCheckboxEl)
export const checkTargetLineCheckbox = () => checkCheckbox(targetLineCheckboxEl)

export const setTargetLineValue = (text) =>
typeInput(targetLineValueInputEl, text)

export const setTargetLineLabel = (text) =>
typeInput(targetLineLabelInputEl, text)

export const clickBaseLineCheckbox = () => clickCheckbox(baseLineCheckboxEl)
export const checkBaseLineCheckbox = () => checkCheckbox(baseLineCheckboxEl)

export const setBaseLineValue = (text) => typeInput(baseLineValueInputEl, text)

Expand Down
4 changes: 2 additions & 2 deletions cypress/elements/optionsModal/outliers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clickCheckbox } from '../common.js'
import { checkCheckbox } from '../common.js'

const outliersCheckboxEl = 'option-outliers-enabled-checkbox'

export const clickOutliersCheckbox = () => clickCheckbox(outliersCheckboxEl)
export const checkOutliersCheckbox = () => checkCheckbox(outliersCheckboxEl)
100 changes: 100 additions & 0 deletions cypress/elements/optionsModal/totals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
export const colTotalsOptionEl = 'option-col-totals'
const colSubTotalsOptionEl = 'option-col-subtotals'
const rowTotalsOptionEl = 'option-row-totals'
const rowSubTotalsOptionEl = 'option-row-subtotals'

export const expectColumnsTotalsToBeDisabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsTotalsToBeEnabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.disabled')

export const expectColumnsTotalsToBeChecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsTotalsToBeUnchecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectColumnsSubTotalsToBeDisabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsSubTotalsToBeEnabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectColumnsSubTotalsToBeChecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsSubTotalsToBeUnchecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsTotalsToBeDisabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsTotalsToBeEnabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsTotalsToBeChecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsTotalsToBeUnchecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsSubTotalsToBeDisabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsSubTotalsToBeEnabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsSubTotalsToBeChecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsSubTotalsToBeUnchecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')
7 changes: 7 additions & 0 deletions cypress/elements/pivotTable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const valueCellEl = 'visualization-value-cell'
const headerCellEl = 'visualization-column-header'

export const clickTableValueCell = (index) =>
cy.getBySel(valueCellEl).eq(index).click()

export const expectTableValueCellsToHaveLength = (length) =>
cy.getBySel(valueCellEl).should('have.length', length)

export const expectTableValueCellToContainValue = (index, value) =>
cy.getBySel(valueCellEl).eq(index).contains(value)

export const clickTableHeaderCell = (name) =>
cy.getBySel(headerCellEl).contains(name).click()
Loading

0 comments on commit f57b00f

Please sign in to comment.