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: DashboardsBar onExpandedChanged must be a function #1613

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cypress/integration/ui/error_scenarios.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/components/ControlBar/ViewControlBar/DashboardsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ DashboardsBar.propTypes = {
onExpandedChanged: PropTypes.func,
}

DashboardsBar.defaultProps = {
expanded: false,
onExpandedChanged: Function.prototype,
}

const mapStateToProps = state => ({
userRows: sGetControlBarUserRows(state),
})
Expand Down