Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: v100.3.1 #2907

Merged
merged 10 commits into from
Nov 8, 2023
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ module.exports = defineConfig({
reporterOptions: {
endpoint: process.env.REPORTPORTAL_ENDPOINT,
apiKey: process.env.REPORTPORTAL_API_KEY,
launch: 'data_visualizer_app_master',
launch: 'data_visualizer_app',
project: process.env.REPORTPORTAL_PROJECT,
description: '',
autoMerge: true,
parallel: true,
debug: false,
restClientConfig: {
timeout: 360000,
timeout: 660000,
},
attributes: [
{
Expand Down
28 changes: 14 additions & 14 deletions cypress/integration/confirmLeave.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ import {
import { TEST_AOS } from '../utils/data.js'
import { getRandomArrayItem } from '../utils/random.js'

describe('confirm leave modal', () => {
const TEST_AO = getRandomArrayItem(TEST_AOS)

it('navigates to the start page and loads a random saved AO', () => {
describe('Confirm leave modal', () => {
it('Confirm leave modal preserves AO changes when user cancels leave, and discards changes when user approves leave', () => {
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(`replaces the selected period`, () => {

// replaces the selected period
replacePeriodItems(TEST_AO.type)
expectVisualizationToBeVisible(TEST_AO.type)
expectAOTitleToBeDirty()
})
it('tries to open a new AO', () => {

// tries to open a new AO
createNewAO()
expectConfirmLeaveModalToBeVisible()
})
it('cancels leave', () => {

// cancels leave
confirmLeave(false)
expectVisualizationToBeVisible(TEST_AO.type)
expectAOTitleToBeDirty()
})
it('tries to open a new AO', () => {

// tries to open a new AO
createNewAO()
expectConfirmLeaveModalToBeVisible()
})
it('confirms leave', () => {

// confirms leave
confirmLeave(true)
expectStartScreenToBeVisible()
expectVisualizationToNotBeVisible()
Expand Down
85 changes: 42 additions & 43 deletions cypress/integration/new.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,62 +41,61 @@ const TEST_INDICATOR_NAMES = TEST_INDICATORS.slice(1, 3).map(
)

describe('creating a new AO', () => {
it('navigates to the start page', () => {
goToStartPage()
})
visTypes.forEach((visType) => {
const visTypeName = visTypeDisplayNames[visType]
describe(visTypeName, () => {
it('creates a new AO', () => {
createNewAO()
expectStoreCurrentToBeEmpty()
expectVisualizationToNotBeVisible()
expectVisTypeToBeDefault()
})
it('changes vis type', () => {
changeVisType(visTypeName)
expectVisTypeToBeValue(visTypeName)
})
it('adds dimensions', () => {
openDimension(DIMENSION_ID_DATA)

if (visType === VIS_TYPE_SCATTER) {
selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1))
switchDataTab('Horizontal')
selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1))
} else {
if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) {
// Gauge and SV can only have 1 data item
TEST_DATA_ELEMENT_NAMES.splice(1)
}
it(`create AO of type ${visTypeName}`, () => {
// navigates to start page
goToStartPage()

// creates a new AO
createNewAO()
expectStoreCurrentToBeEmpty()
expectVisualizationToNotBeVisible()
expectVisTypeToBeDefault()

// changes vis type
changeVisType(visTypeName)
expectVisTypeToBeValue(visTypeName)

selectDataElements(TEST_DATA_ELEMENT_NAMES)
// adds dimensions
openDimension(DIMENSION_ID_DATA)

if (visType === VIS_TYPE_SCATTER) {
selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1))
switchDataTab('Horizontal')
selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1))
} else {
if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) {
// Gauge and SV can only have 1 data item
TEST_DATA_ELEMENT_NAMES.splice(1)
}

clickDimensionModalUpdateButton()
selectDataElements(TEST_DATA_ELEMENT_NAMES)
}

expectVisualizationToBeVisible(visType)
clickDimensionModalUpdateButton()

isYearOverYear(visType) && expectAOTitleToBeUnsaved()
expectVisualizationToBeVisible(visType)

// FIXME: Store is always in default state
/* !isYearOverYear(visType)
isYearOverYear(visType) && expectAOTitleToBeUnsaved()

// FIXME: Store is always in default state
/* !isYearOverYear(visType)
? expectStoreCurrentColumnsToHaveLength(1)
: expectAOTitleToBeUnsaved() */

if (visType !== VIS_TYPE_SCATTER) {
TEST_DATA_ELEMENT_NAMES.forEach((item) =>
expectChartToContainDimensionItem(visType, item)
)
}
})
if (visType !== VIS_TYPE_SCATTER) {
TEST_DATA_ELEMENT_NAMES.forEach((item) =>
expectChartToContainDimensionItem(visType, item)
)
}

if ([VIS_TYPE_SINGLE_VALUE, VIS_TYPE_GAUGE].includes(visType)) {
it('Data is locked to Series', () => {
expectDimensionOnAxisToHaveLockIcon(
DIMENSION_ID_DATA,
AXIS_ID_COLUMNS
)
})
expectDimensionOnAxisToHaveLockIcon(
DIMENSION_ID_DATA,
AXIS_ID_COLUMNS
)
}
})
})
Expand Down
Loading
Loading