Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-09 21:07:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-09 21:07:44 +0300
commit453634293e24164ffaa5cd708e47a1cebc07bcd3 (patch)
treee49bb067fc508f57b03ac582872c4b1215eec326 /spec/features/task_lists_spec.rb
parent608d6aaa3d80a33862ca2c29d96bfd687b1a011b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/task_lists_spec.rb')
-rw-r--r--spec/features/task_lists_spec.rb72
1 files changed, 72 insertions, 0 deletions
diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb
index d35726fe125..95741d6cdf0 100644
--- a/spec/features/task_lists_spec.rb
+++ b/spec/features/task_lists_spec.rb
@@ -333,6 +333,41 @@ RSpec.describe 'Task Lists', :js, feature_category: :team_planning do
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 1)
expect(page).to have_selector('ul input[checked]', count: 1)
+ expect(page).to have_content('1 of 1 checklist item completed')
+ end
+ end
+
+ describe 'tasks in code blocks' do
+ let(:code_tasks_markdown) do
+ <<-EOT.strip_heredoc
+ ```
+ - [ ] a
+ ```
+
+ - [ ] b
+ EOT
+ end
+
+ let!(:issue) { create(:issue, description: code_tasks_markdown, author: user, project: project) }
+
+ it 'renders' do
+ visit_issue(project, issue)
+ wait_for_requests
+
+ expect(page).to have_selector('ul.task-list', count: 1)
+ expect(page).to have_selector('li.task-list-item', count: 1)
+ expect(page).to have_selector('ul input[checked]', count: 0)
+
+ find('.task-list-item-checkbox').click
+ wait_for_requests
+
+ visit_issue(project, issue)
+ wait_for_requests
+
+ expect(page).to have_selector('ul.task-list', count: 1)
+ expect(page).to have_selector('li.task-list-item', count: 1)
+ expect(page).to have_selector('ul input[checked]', count: 1)
+ expect(page).to have_content('1 of 1 checklist item completed')
end
end
@@ -370,6 +405,43 @@ RSpec.describe 'Task Lists', :js, feature_category: :team_planning do
end
end
+ describe 'summary properly formatted' do
+ let(:summary_markdown) do
+ <<-EOT.strip_heredoc
+ <details open>
+ <summary>Valid detail/summary with tasklist</summary>
+
+ - [ ] People Ops: do such and such
+
+ </details>
+
+ * [x] Task 1
+ EOT
+ end
+
+ let!(:issue) { create(:issue, description: summary_markdown, author: user, project: project) }
+
+ it 'renders' do
+ visit_issue(project, issue)
+ wait_for_requests
+
+ expect(page).to have_selector('ul.task-list', count: 2)
+ expect(page).to have_selector('li.task-list-item', count: 2)
+ expect(page).to have_selector('ul input[checked]', count: 1)
+
+ first('.task-list-item-checkbox').click
+ wait_for_requests
+
+ visit_issue(project, issue)
+ wait_for_requests
+
+ expect(page).to have_selector('ul.task-list', count: 2)
+ expect(page).to have_selector('li.task-list-item', count: 2)
+ expect(page).to have_selector('ul input[checked]', count: 2)
+ expect(page).to have_content('2 of 2 checklist items completed')
+ end
+ end
+
describe 'markdown starting with new line character' do
let(:markdown_starting_with_new_line) do
<<-EOT.strip_heredoc