Commit 7e6026ca authored by Phil Hughes's avatar Phil Hughes

Updated specs

parent c24d849f
......@@ -59,6 +59,9 @@ const extraMilestones = require('../mixins/extra_milestones');
},
},
methods: {
refreshPage() {
location.href = location.pathname;
},
loadMilestones(e) {
this.milestoneDropdownOpen = !this.milestoneDropdownOpen;
BoardService.loadMilestones.call(this);
......@@ -78,8 +81,12 @@ const extraMilestones = require('../mixins/extra_milestones');
gl.boardService.createBoard(this.board)
.then(() => {
if (this.currentBoard && this.currentPage !== 'new') {
// We reload the page to make sure the store & state of the app are correct
location.reload();
this.currentBoard.name = this.board.name;
if (this.currentPage === 'milestone') {
// We reload the page to make sure the store & state of the app are correct
this.refreshPage();
}
}
// Enable the button thanks to our jQuery disabling it
......
......@@ -26,7 +26,7 @@ describe 'Board with milestone', :feature, :js do
click_link 'test'
expect(find('.js-milestone-select')).to have_content(milestone.title)
expect(find('.tokens-container')).to have_content(milestone.title)
expect(all('.board')[1]).to have_selector('.card', count: 1)
end
end
......@@ -48,21 +48,22 @@ describe 'Board with milestone', :feature, :js do
click_link board.name
end
expect(find('.js-milestone-select')).to have_content(milestone.title)
expect(find('.tokens-container')).to have_content(milestone.title)
expect(all('.board')[1]).to have_selector('.card', count: 1)
end
it 'sets board to any milestone' do
update_board_milestone('Any Milestone')
expect(find('.js-milestone-select')).not_to have_content(milestone.title)
expect(page).not_to have_css('.js-visual-token')
expect(find('.tokens-container')).not_to have_content(milestone.title)
expect(all('.board')[1]).to have_selector('.card', count: 2)
end
it 'sets board to upcoming milestone' do
update_board_milestone('Upcoming')
expect(find('.js-milestone-select')).not_to have_content(milestone.title)
expect(find('.tokens-container')).not_to have_content(milestone.title)
expect(all('.board')[1]).to have_selector('.card', count: 0)
end
end
......
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