summaryrefslogtreecommitdiff
path: root/spec/frontend/image_diff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-03-23 17:52:35 +0100
committerWinnie Hellmann <winnie@gitlab.com>2019-03-23 17:53:46 +0100
commit514ee63826e47229bfd03bdbb740f2dd1eae1d03 (patch)
tree3f0d96a4402e8aa54c375084cc4c5e6cf546824b /spec/frontend/image_diff
parent6d330015dfdb1979a0773c87c53b84cc86b28a6d (diff)
downloadgitlab-ce-514ee63826e47229bfd03bdbb740f2dd1eae1d03.tar.gz
Move some tests from Karma to Jest
Diffstat (limited to 'spec/frontend/image_diff')
-rw-r--r--spec/frontend/image_diff/view_types_spec.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/frontend/image_diff/view_types_spec.js b/spec/frontend/image_diff/view_types_spec.js
new file mode 100644
index 00000000000..e9639f46497
--- /dev/null
+++ b/spec/frontend/image_diff/view_types_spec.js
@@ -0,0 +1,24 @@
+import { viewTypes, isValidViewType } from '~/image_diff/view_types';
+
+describe('viewTypes', () => {
+ describe('isValidViewType', () => {
+ it('should return true for TWO_UP', () => {
+ expect(isValidViewType(viewTypes.TWO_UP)).toEqual(true);
+ });
+
+ it('should return true for SWIPE', () => {
+ expect(isValidViewType(viewTypes.SWIPE)).toEqual(true);
+ });
+
+ it('should return true for ONION_SKIN', () => {
+ expect(isValidViewType(viewTypes.ONION_SKIN)).toEqual(true);
+ });
+
+ it('should return false for non view types', () => {
+ expect(isValidViewType('some-view-type')).toEqual(false);
+ expect(isValidViewType(null)).toEqual(false);
+ expect(isValidViewType(undefined)).toEqual(false);
+ expect(isValidViewType('')).toEqual(false);
+ });
+ });
+});