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

user_avatar_svg_spec.js « user_avatar « components « vue_shared « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9152fa8e12f1c38495723ec3ef801a3e88468fd9 (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
25
26
27
28
29
import Vue from 'vue';
import UserAvatarSvg from '~/vue_shared/components/user_avatar/user_avatar_svg.vue';
import avatarSvg from 'icons/_icon_random.svg';

const UserAvatarSvgComponent = Vue.extend(UserAvatarSvg);

describe('User Avatar Svg Component', function() {
  describe('Initialization', function() {
    beforeEach(function() {
      this.propsData = {
        size: 99,
        svg: avatarSvg,
      };

      this.userAvatarSvg = new UserAvatarSvgComponent({
        propsData: this.propsData,
      }).$mount();
    });

    it('should return a defined Vue component', function() {
      expect(this.userAvatarSvg).toBeDefined();
    });

    it('should have <svg> as a child element', function() {
      expect(this.userAvatarSvg.$el.tagName).toEqual('svg');
      expect(this.userAvatarSvg.$el.innerHTML).toContain('<path');
    });
  });
});