Commit 1284ea5a authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'upgrade-bootstrap-vue/specs-update-registry' into 'master'

Prepare registry specs for BootstrapVue upgrade

See merge request gitlab-org/gitlab!20504
parents 1e661088 bf514965
......@@ -39,6 +39,8 @@ describe('Registry List', () => {
// See https://github.com/vuejs/vue-test-utils/issues/532.
Vue.config.silent = true;
wrapper = mount(registry, {
attachToDocument: true,
sync: false,
propsData,
computed: {
repos() {
......@@ -67,6 +69,8 @@ describe('Registry List', () => {
let localWrapper;
beforeEach(() => {
localWrapper = mount(registry, {
attachToDocument: true,
sync: false,
propsData,
computed: {
repos() {
......
......@@ -22,7 +22,14 @@ describe('collapsible registry container', () => {
const findToggleRepos = (w = wrapper) => w.findAll('.js-toggle-repo');
const findDeleteModal = (w = wrapper) => w.find({ ref: 'deleteModal' });
const mountWithStore = config => mount(collapsibleComponent, { ...config, store, localVue });
const mountWithStore = config =>
mount(collapsibleComponent, {
...config,
store,
localVue,
attachToDocument: true,
sync: false,
});
beforeEach(() => {
createFlash.mockClear();
......@@ -63,12 +70,15 @@ describe('collapsible registry container', () => {
it('should be closed by default', () => {
expectIsClosed();
});
it('should be open when user clicks on closed repo', () => {
it('should be open when user clicks on closed repo', done => {
const toggleRepos = findToggleRepos(wrapper);
toggleRepos.at(0).trigger('click');
const container = findContainerImageTags(wrapper);
expect(container.exists()).toBe(true);
expect(wrapper.vm.fetchList).toHaveBeenCalled();
Vue.nextTick(() => {
const container = findContainerImageTags(wrapper);
expect(container.exists()).toBe(true);
expect(wrapper.vm.fetchList).toHaveBeenCalled();
done();
});
});
it('should be closed when the user clicks on an opened repo', done => {
const toggleRepos = findToggleRepos(wrapper);
......
......@@ -6,6 +6,8 @@ describe('Registry Project Empty state', () => {
beforeEach(() => {
wrapper = mount(projectEmptyState, {
attachToDocument: true,
sync: false,
propsData: {
noContainersImage: 'imageUrl',
helpPagePath: 'help',
......
......@@ -28,7 +28,8 @@ describe('table registry', () => {
const findImageId = (w = wrapper) => w.find({ ref: 'imageId' });
const bulkDeletePath = 'path';
const mountWithStore = config => mount(tableRegistry, { ...config, store, localVue });
const mountWithStore = config =>
mount(tableRegistry, { ...config, store, localVue, attachToDocument: true, sync: false });
beforeEach(() => {
// This is needed due to console.error called by vue to emit a warning that stop the tests
......@@ -196,7 +197,7 @@ describe('table registry', () => {
expect(wrapper.vm.handleSingleDelete).toHaveBeenCalledWith(repoPropsData.list[0]);
expect(wrapper.vm.handleMultipleDelete).not.toHaveBeenCalled();
});
it('on ok when multiple items are selected should call muultiDelete', () => {
it('on ok when multiple items are selected should call multiDelete', () => {
wrapper.setData({ itemsToBeDeleted: [0, 1, 2] });
wrapper.vm.onDeletionConfirmed();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment