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/issuable/components/csv_export_modal_spec.js')
-rw-r--r--spec/frontend/issuable/components/csv_export_modal_spec.js32
1 files changed, 19 insertions, 13 deletions
diff --git a/spec/frontend/issuable/components/csv_export_modal_spec.js b/spec/frontend/issuable/components/csv_export_modal_spec.js
index ad4abda6912..f798f87b6b2 100644
--- a/spec/frontend/issuable/components/csv_export_modal_spec.js
+++ b/spec/frontend/issuable/components/csv_export_modal_spec.js
@@ -1,7 +1,8 @@
-import { GlModal, GlIcon, GlButton } from '@gitlab/ui';
+import { GlModal, GlIcon } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import { stubComponent } from 'helpers/stub_component';
import CsvExportModal from '~/issuable/components/csv_export_modal.vue';
+import { __ } from '~/locale';
describe('CsvExportModal', () => {
let wrapper;
@@ -34,7 +35,6 @@ describe('CsvExportModal', () => {
const findModal = () => wrapper.findComponent(GlModal);
const findIcon = () => wrapper.findComponent(GlIcon);
- const findButton = () => wrapper.findComponent(GlButton);
describe('template', () => {
describe.each`
@@ -47,11 +47,25 @@ describe('CsvExportModal', () => {
});
it('displays the modal title "$modalTitle"', () => {
- expect(findModal().text()).toContain(modalTitle);
+ expect(findModal().props('title')).toBe(modalTitle);
});
- it('displays the button with title "$modalTitle"', () => {
- expect(findButton().text()).toBe(modalTitle);
+ it('displays the primary button with title "$modalTitle" and href', () => {
+ expect(findModal().props('actionPrimary')).toMatchObject({
+ text: modalTitle,
+ attributes: {
+ href: 'export/csv/path',
+ variant: 'confirm',
+ 'data-method': 'post',
+ 'data-qa-selector': `export_${issuableType}_button`,
+ 'data-track-action': 'click_button',
+ 'data-track-label': `export_${issuableType}_csv`,
+ },
+ });
+ });
+
+ it('displays the cancel button', () => {
+ expect(findModal().props('actionCancel')).toEqual({ text: __('Cancel') });
});
});
@@ -72,13 +86,5 @@ describe('CsvExportModal', () => {
);
});
});
-
- describe('primary button', () => {
- it('passes the exportCsvPath to the button', () => {
- const exportCsvPath = '/gitlab-org/gitlab-test/-/issues/export_csv';
- wrapper = createComponent({ props: { exportCsvPath } });
- expect(findButton().attributes('href')).toBe(exportCsvPath);
- });
- });
});
});