Commit 846cf06d authored by Phil Hughes's avatar Phil Hughes

Added specs

parent 86b2f90d
/* global Cookies */
const Vue = require('vue'); const Vue = require('vue');
const checkmarkIcon = require('../icons/checkmark'); const checkmarkIcon = require('../icons/checkmark');
...@@ -10,16 +9,6 @@ module.exports = Vue.extend({ ...@@ -10,16 +9,6 @@ module.exports = Vue.extend({
data() { data() {
return ModalStore.store; return ModalStore.store;
}, },
methods: {
closeHelp(openModal) {
Store.state.helpHidden = true;
Cookies.set('boards_backlog_help_hidden', true);
if (openModal) {
this.toggleModal(true);
}
},
},
computed: { computed: {
disabled() { disabled() {
return !Store.state.lists return !Store.state.lists
...@@ -34,7 +23,7 @@ module.exports = Vue.extend({ ...@@ -34,7 +23,7 @@ module.exports = Vue.extend({
type="button" type="button"
class="close" class="close"
aria-label="Close backlog help" aria-label="Close backlog help"
@click="closeHelp(false)"> @click="toggleModal(false)">
<i class="fa fa-times"></i> <i class="fa fa-times"></i>
</button> </button>
</h4> </h4>
...@@ -50,7 +39,7 @@ module.exports = Vue.extend({ ...@@ -50,7 +39,7 @@ module.exports = Vue.extend({
class="btn btn-success" class="btn btn-success"
type="button" type="button"
:disabled="disabled" :disabled="disabled"
@click="closeHelp(true)"> @click="toggleModal(true)">
Add issues Add issues
</button> </button>
</div> </div>
......
/* global Cookies */
(() => { (() => {
const Store = gl.issueBoards.BoardsStore;
const ModalStore = gl.issueBoards.ModalStore; const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalMixins = { gl.issueBoards.ModalMixins = {
methods: { methods: {
toggleModal(toggle) { toggleModal(toggleModal) {
ModalStore.store.showAddIssuesModal = toggle; Cookies.set('boards_backlog_help_hidden', true);
Store.state.helpHidden = true;
ModalStore.store.showAddIssuesModal = toggleModal;
}, },
changeTab(tab) { changeTab(tab) {
ModalStore.store.activeTab = tab; ModalStore.store.activeTab = tab;
......
require 'rails_helper'
describe 'Issue Boards', :feature, :js do
include WaitForVueResource
let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) }
let(:user) { create(:user) }
let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:list1) { create(:list, board: board, label: planning, position: 0) }
before do
project.team << [user, :master]
login_as(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource
end
it 'shows backlog help box' do
expect(page).to have_selector('.boards-backlog-help')
end
it 'closes backlog help box' do
page.within '.boards-backlog-help' do
find('.close').click
end
expect(page).not_to have_selector('.boards-backlog-help')
end
it 'closes backlog help box when clicking add issues button inside box' do
page.within '.boards-backlog-help' do
click_button 'Add issues'
end
expect(page).not_to have_selector('.boards-backlog-help')
end
it 'closes backlog help box when clicking add issues button' do
page.within '.issue-boards-search' do
click_button 'Add issues'
end
expect(page).not_to have_selector('.boards-backlog-help')
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