Commit 285049b9 authored by Phil Hughes's avatar Phil Hughes

spec updates

parent f452c1aa
...@@ -11,7 +11,7 @@ gl.issueBoards.ModalFooterListsDropdown = Vue.extend({ ...@@ -11,7 +11,7 @@ gl.issueBoards.ModalFooterListsDropdown = Vue.extend({
}, },
computed: { computed: {
selected() { selected() {
return this.modal.selectedList || this.state.lists[0]; return this.modal.selectedList || this.state.lists[1];
}, },
}, },
destroyed() { destroyed() {
......
...@@ -51,7 +51,7 @@ gl.issueBoards.BoardsStore = { ...@@ -51,7 +51,7 @@ gl.issueBoards.BoardsStore = {
}, },
shouldAddBlankState () { shouldAddBlankState () {
// Decide whether to add the blank state // Decide whether to add the blank state
return !(this.state.lists.filter(list => list.type !== 'backlog' && list.type !== 'done')[0]); return !(this.state.lists.filter(list => list.type !== 'backlog' && list.type !== 'closed')[0]);
}, },
addBlankState () { addBlankState () {
if (!this.shouldAddBlankState() || this.welcomeIsHidden() || this.disabled) return; if (!this.shouldAddBlankState() || this.welcomeIsHidden() || this.disabled) return;
......
...@@ -27,7 +27,7 @@ describe Projects::Boards::ListsController do ...@@ -27,7 +27,7 @@ describe Projects::Boards::ListsController do
parsed_response = JSON.parse(response.body) parsed_response = JSON.parse(response.body)
expect(response).to match_response_schema('lists') expect(response).to match_response_schema('lists')
expect(parsed_response.length).to eq 2 expect(parsed_response.length).to eq 3
end end
context 'with unauthorized user' do context 'with unauthorized user' do
......
...@@ -6,6 +6,12 @@ FactoryGirl.define do ...@@ -6,6 +6,12 @@ FactoryGirl.define do
sequence(:position) sequence(:position)
end end
factory :backlog_list, parent: :list do
list_type :backlog
label nil
position nil
end
factory :closed_list, parent: :list do factory :closed_list, parent: :list do
list_type :closed list_type :closed
label nil label nil
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"id": { "type": "integer" }, "id": { "type": "integer" },
"list_type": { "list_type": {
"type": "string", "type": "string",
"enum": ["label", "closed"] "enum": ["backlog", "label", "closed"]
}, },
"label": { "label": {
"type": ["object", "null"], "type": ["object", "null"],
......
...@@ -14,8 +14,9 @@ describe Boards::CreateService, services: true do ...@@ -14,8 +14,9 @@ describe Boards::CreateService, services: true do
it 'creates the default lists' do it 'creates the default lists' do
board = service.execute board = service.execute
expect(board.lists.size).to eq 1 expect(board.lists.size).to eq 2
expect(board.lists.first).to be_closed expect(board.lists.first).to be_backlog
expect(board.lists.last).to be_closed
end end
end end
......
...@@ -13,6 +13,7 @@ describe Boards::Issues::ListService, services: true do ...@@ -13,6 +13,7 @@ describe Boards::Issues::ListService, services: true do
let(:p2) { create(:label, title: 'P2', project: project, priority: 2) } let(:p2) { create(:label, title: 'P2', project: project, priority: 2) }
let(:p3) { create(:label, title: 'P3', project: project, priority: 3) } let(:p3) { create(:label, title: 'P3', project: project, priority: 3) }
let!(:backlog) { create(:backlog_list, board: board) }
let!(:list1) { create(:list, board: board, label: development, position: 0) } let!(:list1) { create(:list, board: board, label: development, position: 0) }
let!(:list2) { create(:list, board: board, label: testing, position: 1) } let!(:list2) { create(:list, board: board, label: testing, position: 1) }
let!(:closed) { create(:closed_list, board: board) } let!(:closed) { create(:closed_list, board: board) }
...@@ -53,6 +54,14 @@ describe Boards::Issues::ListService, services: true do ...@@ -53,6 +54,14 @@ describe Boards::Issues::ListService, services: true do
expect(issues).to eq [opened_issue2, reopened_issue1, opened_issue1] expect(issues).to eq [opened_issue2, reopened_issue1, opened_issue1]
end end
it 'returns opened issues when listing issues from Backlog' do
params = { board_id: board.id, id: backlog.id }
issues = described_class.new(project, user, params).execute
expect(issues).to eq [opened_issue2, reopened_issue1, opened_issue1]
end
it 'returns closed issues when listing issues from Closed' do it 'returns closed issues when listing issues from Closed' do
params = { board_id: board.id, id: closed.id } params = { board_id: board.id, id: closed.id }
......
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