Commit c9ac28fa authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken task list spec

parent 8345f2e6
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
:quick-actions-docs="quickActionsDocsUrl" :quick-actions-docs="quickActionsDocsUrl"
:add-spacing-classes="false"> :add-spacing-classes="false">
<textarea <textarea
id="note_note"
name="note[note]" name="note[note]"
class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form" class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form"
:data-supports-quick-actions="!isEditing" :data-supports-quick-actions="!isEditing"
......
...@@ -14,11 +14,7 @@ feature 'Member autocomplete', :js do ...@@ -14,11 +14,7 @@ feature 'Member autocomplete', :js do
shared_examples "open suggestions when typing @" do shared_examples "open suggestions when typing @" do
before do before do
page.within('.new-note') do page.within('.new-note') do
if note.noteable_type === 'Issue' find('#note_note').send_keys('@')
find('.js-vue-comment-form').send_keys('@')
else
find('#note_note').send_keys('@')
end
end end
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Task Lists', js: true do feature 'Task Lists' do
include Warden::Test::Helpers include Warden::Test::Helpers
let(:project) { create(:project) } let(:project) { create(:project) }
...@@ -181,7 +181,7 @@ feature 'Task Lists', js: true do ...@@ -181,7 +181,7 @@ feature 'Task Lists', js: true do
project: project, author: user) project: project, author: user)
end end
it 'renders for note body' do it 'renders for note body', :js do
visit_issue(project, issue) visit_issue(project, issue)
expect(page).to have_selector('.note ul.task-list', count: 1) expect(page).to have_selector('.note ul.task-list', count: 1)
...@@ -189,14 +189,14 @@ feature 'Task Lists', js: true do ...@@ -189,14 +189,14 @@ feature 'Task Lists', js: true do
expect(page).to have_selector('.note ul input[checked]', count: 2) expect(page).to have_selector('.note ul input[checked]', count: 2)
end end
it 'contains the required selectors' do it 'contains the required selectors', :js do
visit_issue(project, issue) visit_issue(project, issue)
expect(page).to have_selector('.note .js-task-list-container') expect(page).to have_selector('.note .js-task-list-container')
expect(page).to have_selector('.note .js-task-list-container .task-list .task-list-item .task-list-item-checkbox') expect(page).to have_selector('.note .js-task-list-container .task-list .task-list-item .task-list-item-checkbox')
end end
it 'is only editable by author' do it 'is only editable by author', :js do
visit_issue(project, issue) visit_issue(project, issue)
expect(page).to have_selector('.js-task-list-container') expect(page).to have_selector('.js-task-list-container')
...@@ -214,7 +214,7 @@ feature 'Task Lists', js: true do ...@@ -214,7 +214,7 @@ feature 'Task Lists', js: true do
project: project, author: user) project: project, author: user)
end end
it 'renders for note body' do it 'renders for note body', :js do
visit_issue(project, issue) visit_issue(project, issue)
expect(page).to have_selector('.note ul.task-list', count: 1) expect(page).to have_selector('.note ul.task-list', count: 1)
...@@ -229,7 +229,7 @@ feature 'Task Lists', js: true do ...@@ -229,7 +229,7 @@ feature 'Task Lists', js: true do
project: project, author: user) project: project, author: user)
end end
it 'renders for note body' do it 'renders for note body', :js do
visit_issue(project, issue) visit_issue(project, issue)
expect(page).to have_selector('.note ul.task-list', count: 1) expect(page).to have_selector('.note ul.task-list', count: 1)
...@@ -263,6 +263,7 @@ feature 'Task Lists', js: true do ...@@ -263,6 +263,7 @@ feature 'Task Lists', js: true do
expect(page).to have_selector(container) expect(page).to have_selector(container)
expect(page).to have_selector("#{container} .wiki .task-list .task-list-item .task-list-item-checkbox") expect(page).to have_selector("#{container} .wiki .task-list .task-list-item .task-list-item-checkbox")
expect(page).to have_selector("#{container} .js-task-list-field")
expect(page).to have_selector('form.js-issuable-update') expect(page).to have_selector('form.js-issuable-update')
expect(page).to have_selector('a.btn-close') expect(page).to have_selector('a.btn-close')
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