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/lib/utils/common_utils_spec.js')
-rw-r--r--spec/frontend/lib/utils/common_utils_spec.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/common_utils_spec.js b/spec/frontend/lib/utils/common_utils_spec.js
index 8697249ebf5..6295914b127 100644
--- a/spec/frontend/lib/utils/common_utils_spec.js
+++ b/spec/frontend/lib/utils/common_utils_spec.js
@@ -1213,4 +1213,28 @@ describe('common_utils', () => {
expect(cloned.ref === ref).toBe(false);
});
});
+
+ describe('isDefaultCiConfig', () => {
+ it('returns true when the path is the default CI config path', () => {
+ expect(commonUtils.isDefaultCiConfig('.gitlab-ci.yml')).toBe(true);
+ });
+
+ it('returns false when the path is not the default CI config path', () => {
+ expect(commonUtils.isDefaultCiConfig('some/other/path.yml')).toBe(false);
+ });
+ });
+
+ describe('hasCiConfigExtension', () => {
+ it('returns true when the path is the default CI config path', () => {
+ expect(commonUtils.hasCiConfigExtension('.gitlab-ci.yml')).toBe(true);
+ });
+
+ it('returns true when the path has a CI config extension', () => {
+ expect(commonUtils.hasCiConfigExtension('some/path.gitlab-ci.yml')).toBe(true);
+ });
+
+ it('returns false when the path does not have a CI config extension', () => {
+ expect(commonUtils.hasCiConfigExtension('some/other/path.yml')).toBe(false);
+ });
+ });
});