Merge pull request #13378 from influxdata/fix/dashboards-test
fix(tests): fix flaky dashboards e2e testpull/13412/head
commit
401ec79bff
|
@ -65,6 +65,8 @@ describe('Dashboards', () => {
|
|||
|
||||
cy.getByTestID('card-select-Bashboard-Template').click()
|
||||
|
||||
cy.getByTestID('template-panel').should('exist')
|
||||
|
||||
cy.getByTestID('create-dashboard-button').click()
|
||||
|
||||
cy.getByTestID('dashboard-card').should('have.length', 1)
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
Panel,
|
||||
EmptyState,
|
||||
ComponentSize,
|
||||
ComponentStatus,
|
||||
} from '@influxdata/clockface'
|
||||
import {Overlay, ResponsiveGridSizer} from 'src/clockface'
|
||||
import {
|
||||
|
@ -80,7 +81,10 @@ class DashboardImportFromTemplateOverlay extends PureComponent<
|
|||
</GetResources>
|
||||
{!selectedTemplateSummary && this.emptyState}
|
||||
{selectedTemplateSummary && (
|
||||
<Panel className="import-template-overlay--details">
|
||||
<Panel
|
||||
className="import-template-overlay--details"
|
||||
testID="template-panel"
|
||||
>
|
||||
<Panel.Header
|
||||
title={_.get(selectedTemplateSummary, 'meta.name')}
|
||||
/>
|
||||
|
@ -132,6 +136,11 @@ class DashboardImportFromTemplateOverlay extends PureComponent<
|
|||
text="Create Dashboard"
|
||||
onClick={this.onSubmit}
|
||||
key="submit-button"
|
||||
status={
|
||||
this.state.selectedTemplate
|
||||
? ComponentStatus.Default
|
||||
: ComponentStatus.Disabled
|
||||
}
|
||||
testID="create-dashboard-button"
|
||||
color={ComponentColor.Primary}
|
||||
/>,
|
||||
|
@ -189,9 +198,9 @@ class DashboardImportFromTemplateOverlay extends PureComponent<
|
|||
private selectTemplate = (
|
||||
selectedTemplateSummary: TemplateSummary
|
||||
) => async (): Promise<void> => {
|
||||
this.setState({selectedTemplateSummary})
|
||||
const selectedTemplate = await getTemplateByID(selectedTemplateSummary.id)
|
||||
this.setState({
|
||||
selectedTemplateSummary,
|
||||
selectedTemplate,
|
||||
variables: this.getVariablesForTemplate(selectedTemplate),
|
||||
cells: this.getCellsForTemplate(selectedTemplate),
|
||||
|
|
Loading…
Reference in New Issue