summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-01-24 17:18:48 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-01-24 17:18:48 +0000
commit8c9a06c37c4cf9763b3781d7e567a7b442c2152c (patch)
treeb7d8933581a0be08efd4e4681756a11a9675b4dc /spec/features
parentc08b1f707de8333907bc31d9f61ad5e21a4af405 (diff)
parentf30ad3ff1f958ccb783f3fab68269e61f1a79b3d (diff)
downloadgitlab-ce-8c9a06c37c4cf9763b3781d7e567a7b442c2152c.tar.gz
Merge branch '24923_nested_tasks' into 'master'
Fix nested tasks in ordered list Closes #24923 See merge request !8626
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/task_lists_spec.rb44
1 files changed, 43 insertions, 1 deletions
diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb
index abb27c90e0a..a5d14aa19f1 100644
--- a/spec/features/task_lists_spec.rb
+++ b/spec/features/task_lists_spec.rb
@@ -36,6 +36,19 @@ feature 'Task Lists', feature: true do
MARKDOWN
end
+ let(:nested_tasks_markdown) do
+ <<-EOT.strip_heredoc
+ - [ ] Task a
+ - [x] Task a.1
+ - [ ] Task a.2
+ - [ ] Task b
+
+ 1. [ ] Task 1
+ 1. [ ] Task 1.1
+ 1. [x] Task 1.2
+ EOT
+ end
+
before do
Warden.test_mode!
@@ -123,6 +136,35 @@ feature 'Task Lists', feature: true do
expect(page).to have_content("1 of 1 task completed")
end
end
+
+ describe 'nested tasks', js: true do
+ let(:issue) { create(:issue, description: nested_tasks_markdown, author: user, project: project) }
+
+ before { visit_issue(project, issue) }
+
+ it 'renders' do
+ expect(page).to have_selector('ul.task-list', count: 2)
+ expect(page).to have_selector('li.task-list-item', count: 7)
+ expect(page).to have_selector('ul input[checked]', count: 1)
+ expect(page).to have_selector('ol input[checked]', count: 1)
+ end
+
+ it 'solves tasks' do
+ expect(page).to have_content("2 of 7 tasks completed")
+
+ page.find('li.task-list-item', text: 'Task b').find('input').click
+ page.find('li.task-list-item ul li.task-list-item', text: 'Task a.2').find('input').click
+ page.find('li.task-list-item ol li.task-list-item', text: 'Task 1.1').find('input').click
+
+ expect(page).to have_content("5 of 7 tasks completed")
+
+ visit_issue(project, issue) # reload to see new system notes
+
+ expect(page).to have_content('marked the task Task b as complete')
+ expect(page).to have_content('marked the task Task a.2 as complete')
+ expect(page).to have_content('marked the task Task 1.1 as complete')
+ end
+ end
end
describe 'for Notes' do
@@ -236,7 +278,7 @@ feature 'Task Lists', feature: true do
expect(page).to have_content("2 of 6 tasks completed")
end
end
-
+
describe 'single incomplete task' do
let!(:merge) { create(:merge_request, :simple, description: singleIncompleteMarkdown, author: user, source_project: project) }