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 'app/assets/javascripts/pipelines/stores/test_reports/utils.js')
-rw-r--r--app/assets/javascripts/pipelines/stores/test_reports/utils.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/app/assets/javascripts/pipelines/stores/test_reports/utils.js b/app/assets/javascripts/pipelines/stores/test_reports/utils.js
index 5c1f27b166a..63a58798958 100644
--- a/app/assets/javascripts/pipelines/stores/test_reports/utils.js
+++ b/app/assets/javascripts/pipelines/stores/test_reports/utils.js
@@ -1,19 +1,28 @@
import { __, sprintf } from '../../../locale';
import { TestStatus } from '../../constants';
+/**
+ * Removes `./` from the beginning of a file path so it can be appended onto a blob path
+ * @param {String} file
+ * @returns {String} - formatted value
+ */
+export function formatFilePath(file) {
+ return file.replace(/^\.?\/*/, '');
+}
+
export function iconForTestStatus(status) {
switch (status) {
case TestStatus.SUCCESS:
- return 'status_success_borderless';
+ return 'status_success';
case TestStatus.FAILED:
- return 'status_failed_borderless';
+ return 'status_failed';
case TestStatus.ERROR:
- return 'status_warning_borderless';
+ return 'status_warning';
case TestStatus.SKIPPED:
- return 'status_skipped_borderless';
+ return 'status_skipped';
case TestStatus.UNKNOWN:
default:
- return 'status_notfound_borderless';
+ return 'status_notfound';
}
}