Commit 378d196c authored by Emily Ring's avatar Emily Ring

Moved environment_external_url_spec to jest test

Moved file from spec/javascripts to spec/frontend.
Updated tests from karma testing to jest testing.
parent 28f2ab29
import { shallowMount } from '@vue/test-utils';
import ExternalUrlComp from '~/environments/components/environment_external_url.vue';
describe('External URL Component', () => {
let wrapper;
const externalUrl = 'https://gitlab.com';
beforeEach(() => {
wrapper = shallowMount(ExternalUrlComp, { propsData: { externalUrl } });
});
it('should link to the provided externalUrl prop', () => {
expect(wrapper.attributes('href')).toEqual(externalUrl);
expect(wrapper.find('a').exists()).toBe(true);
});
});
import Vue from 'vue';
import externalUrlComp from '~/environments/components/environment_external_url.vue';
describe('External URL Component', () => {
let ExternalUrlComponent;
beforeEach(() => {
ExternalUrlComponent = Vue.extend(externalUrlComp);
});
it('should link to the provided externalUrl prop', () => {
const externalURL = 'https://gitlab.com';
const component = new ExternalUrlComponent({
propsData: {
externalUrl: externalURL,
},
}).$mount();
expect(component.$el.getAttribute('href')).toEqual(externalURL);
expect(component.$el.querySelector('fa-external-link')).toBeDefined();
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment