debian-mirror-gitlab/app/assets/javascripts/pipelines/stores/test_reports/getters.js

19 lines
531 B
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import { addIconStatus, formattedTime } from './utils';
2019-12-26 22:10:19 +05:30
export const getTestSuites = state => {
const { test_suites: testSuites = [] } = state.testReports;
return testSuites.map(suite => ({
...suite,
formattedTime: formattedTime(suite.total_time),
}));
};
2020-07-28 23:09:34 +05:30
export const getSelectedSuite = state =>
state.testReports?.test_suites?.[state.selectedSuiteIndex] || {};
2019-12-26 22:10:19 +05:30
2020-07-28 23:09:34 +05:30
export const getSuiteTests = state => {
const { test_cases: testCases = [] } = getSelectedSuite(state);
2020-11-24 15:15:51 +05:30
return testCases.map(addIconStatus);
2019-12-26 22:10:19 +05:30
};