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

view_types_spec.js « image_diff « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9639f464974ee8e1c35d47be1140e34cff13d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
    });
  });
});