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

Added specs

parent 86b2f90d
/* global Cookies */
const Vue = require('vue');
const checkmarkIcon = require('../icons/checkmark');
......@@ -10,16 +9,6 @@ module.exports = Vue.extend({
data() {
return ModalStore.store;
},
methods: {
closeHelp(openModal) {
Store.state.helpHidden = true;
Cookies.set('boards_backlog_help_hidden', true);
if (openModal) {
this.toggleModal(true);
}
},
},
computed: {
disabled() {
return !Store.state.lists
......@@ -34,7 +23,7 @@ module.exports = Vue.extend({
type="button"
class="close"
aria-label="Close backlog help"
@click="closeHelp(false)">
@click="toggleModal(false)">
<i class="fa fa-times"></i>
</button>
</h4>
......@@ -50,7 +39,7 @@ module.exports = Vue.extend({
class="btn btn-success"
type="button"
:disabled="disabled"
@click="closeHelp(true)">
@click="toggleModal(true)">
Add issues
</button>
</div>
......
/* global Cookies */
(() => {
const Store = gl.issueBoards.BoardsStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalMixins = {
methods: {
toggleModal(toggle) {
ModalStore.store.showAddIssuesModal = toggle;
toggleModal(toggleModal) {
Cookies.set('boards_backlog_help_hidden', true);
Store.state.helpHidden = true;
ModalStore.store.showAddIssuesModal = toggleModal;
},
changeTab(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