summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_shared/components/modal_spec.js
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-02-28 21:47:44 +0000
committerWinnie Hellmann <winnie@gitlab.com>2018-03-22 10:48:17 +0100
commit07487628f4c900f4eb09e3cf11a525be0498bd58 (patch)
treea057cb4dcba0fa57966f4a98fe45cc92df1fdf90 /spec/javascripts/vue_shared/components/modal_spec.js
parent9b4b79fffe3b93c2479c31873073d6a7f93baf5a (diff)
downloadgitlab-ce-07487628f4c900f4eb09e3cf11a525be0498bd58.tar.gz
Rename modal.vue to deprecated_modal.vuewinh-deprecate-old-modal
Diffstat (limited to 'spec/javascripts/vue_shared/components/modal_spec.js')
-rw-r--r--spec/javascripts/vue_shared/components/modal_spec.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/spec/javascripts/vue_shared/components/modal_spec.js b/spec/javascripts/vue_shared/components/modal_spec.js
deleted file mode 100644
index d01a94c25e5..00000000000
--- a/spec/javascripts/vue_shared/components/modal_spec.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import $ from 'jquery';
-import Vue from 'vue';
-import modal from '~/vue_shared/components/modal.vue';
-import mountComponent from 'spec/helpers/vue_mount_component_helper';
-
-const modalComponent = Vue.extend(modal);
-
-describe('Modal', () => {
- let vm;
-
- afterEach(() => {
- vm.$destroy();
- });
-
- describe('props', () => {
- describe('without primaryButtonLabel', () => {
- beforeEach(() => {
- vm = mountComponent(modalComponent, {
- primaryButtonLabel: null,
- });
- });
-
- it('does not render a primary button', () => {
- expect(vm.$el.querySelector('.js-primary-button')).toBeNull();
- });
- });
-
- describe('with id', () => {
- describe('does not render a primary button', () => {
- beforeEach(() => {
- vm = mountComponent(modalComponent, {
- id: 'my-modal',
- });
- });
-
- it('assigns the id to the modal', () => {
- expect(vm.$el.querySelector('#my-modal.modal')).not.toBeNull();
- });
-
- it('does not show the modal immediately', () => {
- expect(vm.$el.querySelector('#my-modal.modal')).not.toHaveClass('show');
- });
-
- it('does not show a backdrop', () => {
- expect(vm.$el.querySelector('modal-backdrop')).toBeNull();
- });
- });
- });
-
- it('works with data-toggle="modal"', (done) => {
- setFixtures(`
- <button id="modal-button" data-toggle="modal" data-target="#my-modal"></button>
- <div id="modal-container"></div>
- `);
-
- const modalContainer = document.getElementById('modal-container');
- const modalButton = document.getElementById('modal-button');
- vm = mountComponent(modalComponent, {
- id: 'my-modal',
- }, modalContainer);
- const modalElement = vm.$el.querySelector('#my-modal');
- $(modalElement).on('shown.bs.modal', () => done());
-
- modalButton.click();
- });
- });
-});