Fixed modal lists dropdown not updating when list is deleted
This commit is contained in:
parent
8c5e50e12b
commit
fee064be01
|
@ -71,10 +71,6 @@ $(() => {
|
|||
|
||||
Store.addBlankState();
|
||||
this.loading = false;
|
||||
|
||||
if (this.state.lists.length > 0) {
|
||||
ModalStore.store.selectedList = this.state.lists[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -11,9 +11,12 @@
|
|||
},
|
||||
computed: {
|
||||
selected() {
|
||||
return this.modal.selectedList;
|
||||
return this.modal.selectedList || this.state.lists[0];
|
||||
},
|
||||
},
|
||||
destroyed() {
|
||||
this.modal.selectedList = null;
|
||||
},
|
||||
template: `
|
||||
<div class="dropdown inline">
|
||||
<button
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
selectedIssues: [],
|
||||
showAddIssuesModal: false,
|
||||
activeTab: 'all',
|
||||
selectedList: {},
|
||||
selectedList: null,
|
||||
searchTerm: '',
|
||||
loading: false,
|
||||
loadingNewPage: false,
|
||||
|
|
|
@ -76,6 +76,27 @@ describe 'Issue Boards add issue modal', :feature, :js do
|
|||
end
|
||||
end
|
||||
|
||||
context 'list dropdown' do
|
||||
it 'resets after deleting list' do
|
||||
page.within('.add-issues-modal') do
|
||||
expect(find('.add-issues-footer')).to have_button(planning.title)
|
||||
|
||||
click_button 'Cancel'
|
||||
end
|
||||
|
||||
first('.board-delete').click
|
||||
|
||||
click_button('Add issues')
|
||||
|
||||
wait_for_vue_resource
|
||||
|
||||
page.within('.add-issues-modal') do
|
||||
expect(find('.add-issues-footer')).not_to have_button(planning.title)
|
||||
expect(find('.add-issues-footer')).to have_button(label.title)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'search' do
|
||||
it 'returns issues' do
|
||||
page.within('.add-issues-modal') do
|
||||
|
|
Loading…
Reference in New Issue