591c9bc98c
* 12781 - Add common component for small modal windows * 12781 - Fix drop cap layout and hide footer * 12781 - Implement drop cap reached and won challenge modals * 12781 - Couple small fixes * 12781 - Remove added drop cap modal test convenience * Less assumptions in small-modal component * 12781 - Fix already migrated small modals * Figured out how to properly test Bootstrap modals * 12781 - Add unit test for success modal * 12781 - Some more steps towards integrating successModal.vue * 12781 - Use small modal mixin in success modal * 12781 - Optimize templating in successModal * 12781 - Revert AppFooter additions * 12781 - Add test case and remove unnecessary method
34 lines
901 B
JavaScript
34 lines
901 B
JavaScript
import { mount, createLocalVue } from '@vue/test-utils';
|
|
import BootstrapVue from 'bootstrap-vue';
|
|
import Store from '@/libs/store';
|
|
|
|
import smallModal from '@/components/ui/modal/smallModal';
|
|
|
|
const localVue = createLocalVue();
|
|
localVue.use(Store);
|
|
localVue.use(BootstrapVue);
|
|
|
|
describe('Small modal', () => {
|
|
let wrapper;
|
|
beforeEach(async () => {
|
|
wrapper = mount(smallModal, {
|
|
store: new Store({
|
|
state: {},
|
|
getters: {},
|
|
actions: {},
|
|
}),
|
|
propsData: {
|
|
id: 'test-small-modal',
|
|
title: 'Test title',
|
|
},
|
|
localVue,
|
|
mocks: { $t: (s, args) => s + JSON.stringify(args) },
|
|
});
|
|
wrapper.setData({ disableLazyRender: true });
|
|
});
|
|
|
|
it('Displays passed in title in Bootstrap modal with passed in ID', () => {
|
|
expect(wrapper.find('#test-small-modal .modal-sm .modal-title').text()).to.equal('Test title');
|
|
});
|
|
});
|