diff options
Diffstat (limited to 'spec/frontend/pages/projects/new/components/new_project_push_tip_popover_spec.js')
-rw-r--r-- | spec/frontend/pages/projects/new/components/new_project_push_tip_popover_spec.js | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/spec/frontend/pages/projects/new/components/new_project_push_tip_popover_spec.js b/spec/frontend/pages/projects/new/components/new_project_push_tip_popover_spec.js deleted file mode 100644 index d4cf8c78600..00000000000 --- a/spec/frontend/pages/projects/new/components/new_project_push_tip_popover_spec.js +++ /dev/null @@ -1,75 +0,0 @@ -import { GlPopover, GlFormInputGroup } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import NewProjectPushTipPopover from '~/pages/projects/new/components/new_project_push_tip_popover.vue'; -import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; - -describe('New project push tip popover', () => { - let wrapper; - const targetId = 'target'; - const pushToCreateProjectCommand = 'command'; - const workingWithProjectsHelpPath = 'path'; - - const findPopover = () => wrapper.findComponent(GlPopover); - const findClipboardButton = () => wrapper.findComponent(ClipboardButton); - const findFormInput = () => wrapper.findComponent(GlFormInputGroup); - const findHelpLink = () => wrapper.find('a'); - const findTarget = () => document.getElementById(targetId); - - const buildWrapper = () => { - wrapper = shallowMount(NewProjectPushTipPopover, { - propsData: { - target: findTarget(), - }, - stubs: { - GlFormInputGroup, - }, - provide: { - pushToCreateProjectCommand, - workingWithProjectsHelpPath, - }, - }); - }; - - beforeEach(() => { - setFixtures(`<a id="${targetId}"></a>`); - buildWrapper(); - }); - - afterEach(() => { - wrapper.destroy(); - }); - - it('renders popover that targets the specified target', () => { - expect(findPopover().props()).toMatchObject({ - target: findTarget(), - triggers: 'click blur', - placement: 'top', - title: 'Push to create a project', - }); - }); - - it('renders a readonly form input with the push to create command', () => { - expect(findFormInput().props()).toMatchObject({ - value: pushToCreateProjectCommand, - selectOnClick: true, - }); - expect(findFormInput().attributes()).toMatchObject({ - 'aria-label': 'Push project from command line', - readonly: 'readonly', - }); - }); - - it('allows copying the push command using the clipboard button', () => { - expect(findClipboardButton().props()).toMatchObject({ - text: pushToCreateProjectCommand, - tooltipPlacement: 'right', - title: 'Copy command', - }); - }); - - it('displays a link to open the push command help page reference', () => { - expect(findHelpLink().attributes().href).toBe( - `${workingWithProjectsHelpPath}#push-to-create-a-new-project`, - ); - }); -}); |