diff --git a/cypress/integration/confirmLeave.cy.js b/cypress/integration/confirmLeave.cy.js index 0f49e9ff03..d5bc6af13b 100644 --- a/cypress/integration/confirmLeave.cy.js +++ b/cypress/integration/confirmLeave.cy.js @@ -17,37 +17,35 @@ import { import { TEST_AOS } from '../utils/data.js' import { getRandomArrayItem } from '../utils/random.js' -describe('confirm leave modal', () => { +test('confirm leave modal', () => { const TEST_AO = getRandomArrayItem(TEST_AOS) + // navigates to the start page and loads a random saved AO + goToStartPage() + openAOByName(TEST_AO.name) + expectVisualizationToBeVisible(TEST_AO.type) + expectAOTitleToNotBeDirty() - it('navigates to the start page and loads a random saved AO', () => { - goToStartPage() - openAOByName(TEST_AO.name) - expectVisualizationToBeVisible(TEST_AO.type) - expectAOTitleToNotBeDirty() - }) - it(`replaces the selected period`, () => { - replacePeriodItems(TEST_AO.type) - expectVisualizationToBeVisible(TEST_AO.type) - expectAOTitleToBeDirty() - }) - it('tries to open a new AO', () => { - createNewAO() - expectConfirmLeaveModalToBeVisible() - }) - it('cancels leave', () => { - confirmLeave(false) - expectVisualizationToBeVisible(TEST_AO.type) - expectAOTitleToBeDirty() - }) - it('tries to open a new AO', () => { - createNewAO() - expectConfirmLeaveModalToBeVisible() - }) - it('confirms leave', () => { - confirmLeave(true) - expectStartScreenToBeVisible() - expectVisualizationToNotBeVisible() - expectAOTitleToNotBeDirty() - }) + // replaces the selected period + replacePeriodItems(TEST_AO.type) + expectVisualizationToBeVisible(TEST_AO.type) + expectAOTitleToBeDirty() + + // tries to open a new AO + createNewAO() + expectConfirmLeaveModalToBeVisible() + + // cancels leave + confirmLeave(false) + expectVisualizationToBeVisible(TEST_AO.type) + expectAOTitleToBeDirty() + + // tries to open a new AO + createNewAO() + expectConfirmLeaveModalToBeVisible() + + // confirms leave + confirmLeave(true) + expectStartScreenToBeVisible() + expectVisualizationToNotBeVisible() + expectAOTitleToNotBeDirty() }) diff --git a/cypress/integration/new.cy.js b/cypress/integration/new.cy.js index 33a979783d..756be88ede 100644 --- a/cypress/integration/new.cy.js +++ b/cypress/integration/new.cy.js @@ -47,17 +47,18 @@ describe('creating a new AO', () => { visTypes.forEach((visType) => { const visTypeName = visTypeDisplayNames[visType] describe(visTypeName, () => { - it('creates a new AO', () => { + it(`create AO of type ${visTypeName}`, () => { + // creates a new AO createNewAO() expectStoreCurrentToBeEmpty() expectVisualizationToNotBeVisible() expectVisTypeToBeDefault() - }) - it('changes vis type', () => { + + // changes vis type changeVisType(visTypeName) expectVisTypeToBeValue(visTypeName) - }) - it('adds dimensions', () => { + + // adds dimensions openDimension(DIMENSION_ID_DATA) if (visType === VIS_TYPE_SCATTER) { @@ -90,6 +91,7 @@ describe('creating a new AO', () => { ) } }) + if ([VIS_TYPE_SINGLE_VALUE, VIS_TYPE_GAUGE].includes(visType)) { it('Data is locked to Series', () => { expectDimensionOnAxisToHaveLockIcon(