diff options
Diffstat (limited to 'app/assets/javascripts/pipelines/stores/test_reports/mutations.js')
-rw-r--r-- | app/assets/javascripts/pipelines/stores/test_reports/mutations.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/pipelines/stores/test_reports/mutations.js b/app/assets/javascripts/pipelines/stores/test_reports/mutations.js index cf0bf8483dd..68ee063dda7 100644 --- a/app/assets/javascripts/pipelines/stores/test_reports/mutations.js +++ b/app/assets/javascripts/pipelines/stores/test_reports/mutations.js @@ -1,3 +1,5 @@ +import createFlash from '~/flash'; +import { s__ } from '~/locale'; import * as types from './mutation_types'; export default { @@ -13,6 +15,18 @@ export default { state.testReports.test_suites[index] = { ...suite, hasFullSuite: true }; }, + [types.SET_SUITE_ERROR](state, error) { + const errorMessage = error.response?.data?.errors; + + if (errorMessage) { + state.errorMessage = errorMessage; + } else { + createFlash({ + message: s__('TestReports|There was an error fetching the test suite.'), + }); + } + }, + [types.SET_SELECTED_SUITE_INDEX](state, selectedSuiteIndex) { Object.assign(state, { selectedSuiteIndex }); }, |