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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/registry/explorer/components/delete_button_spec.js')
-rw-r--r--spec/frontend/registry/explorer/components/delete_button_spec.js73
1 files changed, 0 insertions, 73 deletions
diff --git a/spec/frontend/registry/explorer/components/delete_button_spec.js b/spec/frontend/registry/explorer/components/delete_button_spec.js
deleted file mode 100644
index 4597c42add9..00000000000
--- a/spec/frontend/registry/explorer/components/delete_button_spec.js
+++ /dev/null
@@ -1,73 +0,0 @@
-import { GlButton } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
-import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
-import component from '~/registry/explorer/components/delete_button.vue';
-
-describe('delete_button', () => {
- let wrapper;
-
- const defaultProps = {
- title: 'Foo title',
- tooltipTitle: 'Bar tooltipTitle',
- };
-
- const findButton = () => wrapper.find(GlButton);
-
- const mountComponent = (props) => {
- wrapper = shallowMount(component, {
- propsData: {
- ...defaultProps,
- ...props,
- },
- directives: {
- GlTooltip: createMockDirective(),
- },
- });
- };
-
- afterEach(() => {
- wrapper.destroy();
- wrapper = null;
- });
-
- describe('tooltip', () => {
- it('the title is controlled by tooltipTitle prop', () => {
- mountComponent();
- const tooltip = getBinding(wrapper.element, 'gl-tooltip');
- expect(tooltip).toBeDefined();
- expect(tooltip.value.title).toBe(defaultProps.tooltipTitle);
- });
-
- it('is disabled when tooltipTitle is disabled', () => {
- mountComponent({ tooltipDisabled: true });
- const tooltip = getBinding(wrapper.element, 'gl-tooltip');
- expect(tooltip.value.disabled).toBe(true);
- });
-
- describe('button', () => {
- it('exists', () => {
- mountComponent();
- expect(findButton().exists()).toBe(true);
- });
-
- it('has the correct props/attributes bound', () => {
- mountComponent({ disabled: true });
- expect(findButton().attributes()).toMatchObject({
- 'aria-label': 'Foo title',
- icon: 'remove',
- title: 'Foo title',
- variant: 'danger',
- disabled: 'true',
- category: 'secondary',
- });
- });
-
- it('emits a delete event', () => {
- mountComponent();
- expect(wrapper.emitted('delete')).toEqual(undefined);
- findButton().vm.$emit('click');
- expect(wrapper.emitted('delete')).toEqual([[]]);
- });
- });
- });
-});