summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_shared/components/user_access_role_badge_spec.js
blob: 7f25f7c08e7bb739c74cf3626f1dca5a4a6492cf (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
import { GlBadge } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import UserAccessRoleBadge from '~/vue_shared/components/user_access_role_badge.vue';

describe('UserAccessRoleBadge', () => {
  let wrapper;

  const createComponent = ({ slots } = {}) => {
    wrapper = shallowMount(UserAccessRoleBadge, {
      slots,
    });
  };

  it('renders slot content inside GlBadge', () => {
    createComponent({
      slots: {
        default: 'test slot content',
      },
    });

    const badge = wrapper.find(GlBadge);

    expect(badge.exists()).toBe(true);
    expect(badge.html()).toContain('test slot content');
  });
});