diff --git a/cypress/integration/ui/error_scenarios.feature b/cypress/integration/ui/error_scenarios.feature index 95319ddbc..bfebd96af 100644 --- a/cypress/integration/ui/error_scenarios.feature +++ b/cypress/integration/ui/error_scenarios.feature @@ -9,6 +9,8 @@ Feature: Error scenarios Scenario: I navigate to a dashboard that doesn't exist or I don't have access to Given I type an invalid dashboard id in the browser url Then a message displays informing that the dashboard is not found + When I open the "Delivery" dashboard + Then the "Delivery" dashboard displays in view mode @nonmutating Scenario: An error occurs while saving a dashboard that I don't have access to diff --git a/cypress/integration/ui/error_scenarios/error_while_show_description.js b/cypress/integration/ui/error_scenarios/error_while_show_description.js index 76272be23..07e09ffd3 100644 --- a/cypress/integration/ui/error_scenarios/error_while_show_description.js +++ b/cypress/integration/ui/error_scenarios/error_while_show_description.js @@ -1,6 +1,20 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' +import { getApiBaseUrl } from '../../../support/server/utils' // Error scenario + +before(() => { + //first ensure that the description is not currently shown + cy.request({ + method: 'PUT', + url: `${getApiBaseUrl()}/api/userDataStore/dashboard/showDescription`, + headers: { + 'content-type': 'application/json', + }, + body: 'false', + }).then(response => expect(response.status).to.equal(201)) +}) + When('clicking to show description fails', () => { cy.intercept('PUT', 'userDataStore/dashboard/showDescription', { statusCode: 409, diff --git a/src/components/ControlBar/ViewControlBar/DashboardsBar.js b/src/components/ControlBar/ViewControlBar/DashboardsBar.js index 9c30d8a58..a4b119c51 100644 --- a/src/components/ControlBar/ViewControlBar/DashboardsBar.js +++ b/src/components/ControlBar/ViewControlBar/DashboardsBar.js @@ -106,6 +106,11 @@ DashboardsBar.propTypes = { onExpandedChanged: PropTypes.func, } +DashboardsBar.defaultProps = { + expanded: false, + onExpandedChanged: Function.prototype, +} + const mapStateToProps = state => ({ userRows: sGetControlBarUserRows(state), })