Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pipelines/test_reports/stores/getters_spec.js')
-rw-r--r--spec/frontend/pipelines/test_reports/stores/getters_spec.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/frontend/pipelines/test_reports/stores/getters_spec.js b/spec/frontend/pipelines/test_reports/stores/getters_spec.js
index 011a7e68908..ca9ebb54138 100644
--- a/spec/frontend/pipelines/test_reports/stores/getters_spec.js
+++ b/spec/frontend/pipelines/test_reports/stores/getters_spec.js
@@ -9,12 +9,12 @@ describe('Getters TestReports Store', () => {
const defaultState = {
testReports,
- selectedSuite: testReports.test_suites[0],
+ selectedSuiteIndex: 0,
};
const emptyState = {
testReports: {},
- selectedSuite: {},
+ selectedSuite: null,
};
beforeEach(() => {
@@ -47,6 +47,17 @@ describe('Getters TestReports Store', () => {
});
});
+ describe('getSelectedSuite', () => {
+ it('should return the selected suite', () => {
+ setupState();
+
+ const selectedSuite = getters.getSelectedSuite(state);
+ const expected = testReports.test_suites[state.selectedSuiteIndex];
+
+ expect(selectedSuite).toEqual(expected);
+ });
+ });
+
describe('getSuiteTests', () => {
it('should return the test cases inside the suite', () => {
setupState();