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>2022-04-20 13:00:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 13:00:54 +0300
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/services/task_list_toggle_service_spec.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/services/task_list_toggle_service_spec.rb')
-rw-r--r--spec/services/task_list_toggle_service_spec.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/services/task_list_toggle_service_spec.rb b/spec/services/task_list_toggle_service_spec.rb
index 81f80ee926a..f889f298213 100644
--- a/spec/services/task_list_toggle_service_spec.rb
+++ b/spec/services/task_list_toggle_service_spec.rb
@@ -16,6 +16,8 @@ RSpec.describe TaskListToggleService do
- [ ] loose list
with an embedded paragraph
+
+ + [ ] No-break space (U+00A0)
EOT
end
@@ -40,12 +42,17 @@ RSpec.describe TaskListToggleService do
</ul>
</li>
</ol>
- <ul data-sourcepos="9:1-11:28" class="task-list" dir="auto">
- <li data-sourcepos="9:1-11:28" class="task-list-item">
+ <ul data-sourcepos="9:1-12:0" class="task-list" dir="auto">
+ <li data-sourcepos="9:1-12:0" class="task-list-item">
<p data-sourcepos="9:3-9:16"><input type="checkbox" class="task-list-item-checkbox" disabled=""> loose list</p>
<p data-sourcepos="11:3-11:28">with an embedded paragraph</p>
</li>
</ul>
+ <ul data-sourcepos="13:1-13:21" class="task-list" dir="auto">
+ <li data-sourcepos="13:1-13:21" class="task-list-item">
+ <input type="checkbox" class="task-list-item-checkbox" disabled=""> No-break space (U+00A0)
+ </li>
+ </ul>
EOT
end
@@ -79,6 +86,16 @@ RSpec.describe TaskListToggleService do
expect(toggler.updated_markdown_html).to include('disabled checked> loose list')
end
+ it 'checks task with no-break space' do
+ toggler = described_class.new(markdown, markdown_html,
+ toggle_as_checked: true,
+ line_source: '+ [ ] No-break space (U+00A0)', line_number: 13)
+
+ expect(toggler.execute).to be_truthy
+ expect(toggler.updated_markdown.lines[12]).to eq "+ [x] No-break space (U+00A0)"
+ expect(toggler.updated_markdown_html).to include('disabled checked> No-break space (U+00A0)')
+ end
+
it 'returns false if line_source does not match the text' do
toggler = described_class.new(markdown, markdown_html,
toggle_as_checked: false,