Address reviewer feedback

- collapsible container
- table registry
- app spec
parent 4d83f4de
...@@ -36,7 +36,6 @@ describe('Registry List', () => { ...@@ -36,7 +36,6 @@ describe('Registry List', () => {
beforeEach(() => { beforeEach(() => {
wrapper = mount(registry, { wrapper = mount(registry, {
attachToDocument: true, attachToDocument: true,
sync: false,
propsData, propsData,
computed: { computed: {
repos() { repos() {
......
...@@ -27,7 +27,6 @@ describe('collapsible registry container', () => { ...@@ -27,7 +27,6 @@ describe('collapsible registry container', () => {
store, store,
localVue, localVue,
attachToDocument: true, attachToDocument: true,
sync: false,
}); });
beforeEach(() => { beforeEach(() => {
...@@ -77,14 +76,13 @@ describe('collapsible registry container', () => { ...@@ -77,14 +76,13 @@ describe('collapsible registry container', () => {
}); });
}); });
it('should be closed when the user clicks on an opened repo', done => { it('should be closed when the user clicks on an opened repo', () => {
const toggleRepos = findToggleRepos(); const toggleRepos = findToggleRepos();
toggleRepos.at(0).trigger('click'); toggleRepos.at(0).trigger('click');
wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick().then(() => {
toggleRepos.at(0).trigger('click'); toggleRepos.at(0).trigger('click');
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expectIsClosed(); expectIsClosed();
done();
}); });
}); });
}); });
......
...@@ -28,7 +28,7 @@ describe('table registry', () => { ...@@ -28,7 +28,7 @@ describe('table registry', () => {
const bulkDeletePath = 'path'; const bulkDeletePath = 'path';
const mountWithStore = config => const mountWithStore = config =>
mount(tableRegistry, { ...config, store, localVue, attachToDocument: true, sync: false }); mount(tableRegistry, { ...config, store, localVue, attachToDocument: true });
beforeEach(() => { beforeEach(() => {
store = new Vuex.Store({ store = new Vuex.Store({
...@@ -111,15 +111,18 @@ describe('table registry', () => { ...@@ -111,15 +111,18 @@ describe('table registry', () => {
}); });
}); });
it('should delete multiple items when multiple items are selected', done => { it('should delete multiple items when multiple items are selected', () => {
const multiDeleteItems = jest.fn().mockResolvedValue(); const multiDeleteItems = jest.fn().mockResolvedValue();
wrapper.setMethods({ multiDeleteItems }); wrapper.setMethods({ multiDeleteItems });
wrapper.vm.$nextTick(() => { return wrapper.vm
const selectAll = findSelectAllCheckbox(); .$nextTick()
selectAll.trigger('click'); .then(() => {
const selectAll = findSelectAllCheckbox();
wrapper.vm.$nextTick(() => { selectAll.trigger('click');
return wrapper.vm.$nextTick();
})
.then(() => {
const deleteBtn = findDeleteButton(); const deleteBtn = findDeleteButton();
expect(wrapper.vm.selectedItems).toEqual([0, 1]); expect(wrapper.vm.selectedItems).toEqual([0, 1]);
expect(deleteBtn.attributes('disabled')).toEqual(undefined); expect(deleteBtn.attributes('disabled')).toEqual(undefined);
...@@ -131,9 +134,7 @@ describe('table registry', () => { ...@@ -131,9 +134,7 @@ describe('table registry', () => {
path: bulkDeletePath, path: bulkDeletePath,
items: [firstImage.tag, secondImage.tag], items: [firstImage.tag, secondImage.tag],
}); });
done();
}); });
});
}); });
it('should show an error message if bulkDeletePath is not set', () => { it('should show an error message if bulkDeletePath is not set', () => {
......
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