debian-mirror-gitlab/spec/frontend/environments/environment_terminal_button_spec.js
2021-11-18 22:05:49 +05:30

27 lines
804 B
JavaScript

import { mountExtended } from 'helpers/vue_test_utils_helper';
import TerminalComponent from '~/environments/components/environment_terminal_button.vue';
import { __ } from '~/locale';
describe('Terminal Component', () => {
let wrapper;
const terminalPath = '/path';
const mountWithProps = (props) => {
wrapper = mountExtended(TerminalComponent, {
propsData: props,
});
};
beforeEach(() => {
mountWithProps({ terminalPath });
});
it('should render a link to open a web terminal with the provided path', () => {
const link = wrapper.findByRole('menuitem', { name: __('Terminal') });
expect(link.attributes('href')).toBe(terminalPath);
});
it('should render a non-disabled button', () => {
expect(wrapper.classes()).not.toContain('disabled');
});
});