Skip to content

Commit

Permalink
test: rename AO-title to titlebar (DHIS2-15063) (#2435)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott authored and janhenrikoverland committed Aug 15, 2023
1 parent 50a9b56 commit 47c2735
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cypress/elements/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const highchartsSubtitleEl = '.highcharts-subtitle'
const highchartsSeriesKeyItemEl = '.highcharts-legend-item'
const highchartsChartItemEl = '.highcharts-series'
const unsavedVisualizationTitleText = 'Unsaved visualization'
const AOTitleEl = 'AO-title'
const AOTitleDirtyEl = 'AO-title-dirty'
const AOTitleEl = 'titlebar'
const AOTitleDirtyEl = 'titlebar-dirty'
const timeout = {
timeout: 40000,
}
Expand Down
14 changes: 14 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@ import { enableAutoLogin } from '@dhis2/cypress-commands'
import './commands.js'

enableAutoLogin()

const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/
Cypress.on('uncaught:exception', (err) => {
// This prevents a benign error:
// This error means that ResizeObserver was not able to deliver all
// observations within a single animation frame. It is benign (your site
// will not break).
//
// Source: https://stackoverflow.com/a/50387233/1319140
if (resizeObserverLoopErrRe.test(err.message)) {
// returning false here prevents Cypress from failing the test
return false
}
})
4 changes: 2 additions & 2 deletions src/components/TitleBar/TitleBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getSuffix = (titleState) => {
...styles.suffix,
...styles.titleDirty,
}}
data-test="AO-title-dirty"
data-test="titlebar-dirty"
>{`- ${getTitleDirty()}`}</div>
)
default:
Expand All @@ -65,7 +65,7 @@ export const UnconnectedTitleBar = ({ titleState, titleText }) => {
}

return titleText ? (
<div data-test="AO-title" style={styles.titleBar}>
<div data-test="titlebar" style={styles.titleBar}>
<div style={titleStyle}>
{titleText}
{getSuffix(titleState)}
Expand Down

0 comments on commit 47c2735

Please sign in to comment.