import { shallowMount } from '@vue/test-utils';
import VulnerabilityCount from 'ee/security_dashboard/components/vulnerability_count.vue';
import SeverityBadge from 'ee/vue_shared/security_reports/components/severity_badge.vue';

describe('Vulnerability Count', () => {
  let wrapper;

  const findBadge = () => wrapper.find(SeverityBadge);
  const findBody = () => wrapper.find({ ref: 'body' });

  beforeEach(() => {
    wrapper = shallowMount(VulnerabilityCount, {
      propsData: {
        severity: 'high',
        count: 100,
      },
    });
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('should render correctly', () => {
    const header = findBadge();
    const body = findBody();
    expect(header.props('severity')).toBe('high');
    expect(body.text()).toBe('100');
  });
});
