-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [PROD-10520] Add DataIngestionInProgress state
- Loading branch information
Vincent Ardouin-Murat
committed
Jan 18, 2023
1 parent
5a66d4d
commit 24b3b50
Showing
4 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/charts/SimplePowerBIReportEmbed/SimplePowerBiReportEmbed.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import { TypographyTesting } from '../../../tests/MuiComponentsTesting'; | ||
|
||
import { SimplePowerBIReportEmbed } from '.'; | ||
import { LABELS, DEFAULT_SCENARIO, SCENARIO_STATES } from '../../../tests/samples/DashboardSample'; | ||
|
||
const defaultProps = { | ||
index: 0, | ||
refreshTimeout: 15000, | ||
alwaysShowReports: false, | ||
useAAD: false, | ||
lang: 'en', | ||
reports: {}, | ||
reportConfiguration: [], | ||
refreshable: true, | ||
scenario: { ...DEFAULT_SCENARIO }, | ||
labels: LABELS, | ||
}; | ||
|
||
const TypographyPlaceholderLabel = new TypographyTesting({ dataCy: 'dashboard-placeholder' }); | ||
|
||
const setUp = (props) => { | ||
render(<SimplePowerBIReportEmbed {...props} />); | ||
}; | ||
|
||
describe('SimplePowerBiReportEmbed', () => { | ||
describe('PlaceHolder', () => { | ||
const setUpWithScenarioState = (scenarioState) => { | ||
const props = { | ||
...defaultProps, | ||
scenario: { | ||
...defaultProps.scenario, | ||
state: scenarioState, | ||
}, | ||
}; | ||
|
||
setUp(props); | ||
}; | ||
|
||
test.each([ | ||
{ scenarioState: SCENARIO_STATES.noRun, placeHolderLabel: LABELS.noRun.label }, | ||
{ scenarioState: SCENARIO_STATES.dataInTransfer, placeHolderLabel: LABELS.dataInTransfer.label }, | ||
{ scenarioState: SCENARIO_STATES.hasError, placeHolderLabel: LABELS.hasErrors.label }, | ||
{ scenarioState: SCENARIO_STATES.runInProgress, placeHolderLabel: LABELS.inProgress.label }, | ||
{ scenarioState: SCENARIO_STATES.unknown, placeHolderLabel: LABELS.hasUnknownStatus.label }, | ||
])( | ||
'$scenarioState Scenario state display placeholder with label $placeHolderLabel', | ||
({ scenarioState, placeHolderLabel }) => { | ||
setUpWithScenarioState(scenarioState); | ||
expect(TypographyPlaceholderLabel.text).toEqual(placeHolderLabel); | ||
} | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
|
||
export const LABELS = { | ||
noScenario: { | ||
title: 'ut_noScenario_title', | ||
label: 'ut_noScenario_label', | ||
}, | ||
noDashboard: { | ||
label: 'ut_noDashboard_label', | ||
}, | ||
noRun: { | ||
label: 'ut_noRun_label', | ||
}, | ||
inProgress: { | ||
label: 'ut_inProgress_label', | ||
}, | ||
dataInTransfer: { | ||
label: 'ut_dataInTransfer_label', | ||
}, | ||
hasErrors: { | ||
label: 'ut_hasErrors_label', | ||
}, | ||
hasUnknownStatus: { | ||
label: 'ut_hasUnknownStatus_label', | ||
}, | ||
downloadButton: 'ut_downloadButton_label', | ||
refreshTooltip: 'ut_refreshTooltip_label', | ||
errors: { | ||
unknown: 'ut_unknownErrors_label', | ||
details: 'ut_errorsDetails_label', | ||
}, | ||
}; | ||
|
||
export const SCENARIO_STATES = { | ||
noRun: 'Created', | ||
runInProgress: 'Running', | ||
dataInTransfer: 'DataIngestionInProgress', | ||
hasError: 'Failed', | ||
success: 'Successful', | ||
unknown: 'Unknown', | ||
}; | ||
|
||
export const DEFAULT_SCENARIO = { | ||
id: 'ut_sc_id', | ||
name: 'ut_sc_name', | ||
state: SCENARIO_STATES.noRun, | ||
rootId: 'ut_sc_rootId', | ||
parentId: 'ut_sc_parentId', | ||
ownerId: 'ut_sc_ownerId', | ||
solutionId: 'ut_sc_solutionId', | ||
}; |