Fixed search specs

Clean up the events when the modal window is closed
This commit is contained in:
Phil Hughes 2017-03-13 13:05:32 +00:00
parent 3e95bd9765
commit b1d07760e6
3 changed files with 6 additions and 2 deletions

View file

@ -15,7 +15,8 @@ export default {
this.filteredSearch = new FilteredSearchBoards(this.store, false);
},
destroyed() {
beforeDestroy() {
this.filteredSearch.cleanup();
FilteredSearchContainer.container = document;
this.store.path = '';
},

View file

@ -421,7 +421,8 @@
display: flex;
.issues-filters {
width: 100%;
-webkit-flex: 1;
flex: 1;
}
}

View file

@ -107,6 +107,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
it 'returns issues' do
page.within('.add-issues-modal') do
find('.form-control').native.send_keys(issue.title)
find('.form-control').native.send_keys(:enter)
expect(page).to have_selector('.card', count: 1)
end
@ -115,6 +116,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
it 'returns no issues' do
page.within('.add-issues-modal') do
find('.form-control').native.send_keys('testing search')
find('.form-control').native.send_keys(:enter)
expect(page).not_to have_selector('.card')
expect(page).not_to have_content("You haven't added any issues to your project yet")