diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-22 09:24:43 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-22 09:24:43 +0000 |
commit | 380a3b0345b236db9f9bc05bd27b193be89d11cc (patch) | |
tree | af433199b34b8326446f92a49c5b15bd3330b3f2 /test/unit/lib | |
parent | 8c147ca2b1cee4e707035a5d526b11c9a91e8bcc (diff) | |
download | redmine-380a3b0345b236db9f9bc05bd27b193be89d11cc.tar.gz redmine-380a3b0345b236db9f9bc05bd27b193be89d11cc.zip |
Enable task list items for Common Mark text formatting (#35742).
git-svn-id: http://svn.redmine.org/redmine/trunk@21383 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb index c05b8a0a0..ee46e5d8e 100644 --- a/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb @@ -263,6 +263,27 @@ class Redmine::WikiFormatting::CommonMark::FormatterTest < ActionView::TestCase end end + def test_should_support_task_list + text = <<~STR + Task list: + * [ ] Task 1 + * [x] Task 2 + STR + + expected = <<~EXPECTED + <p>Task list:</p> + <ul class="task-list"> + <li class="task-list-item"> + <input type="checkbox" class="task-list-item-checkbox" disabled> Task 1 + </li> + <li class="task-list-item"> + <input type="checkbox" class="task-list-item-checkbox" checked disabled> Task 2</li> + </ul> + EXPECTED + + assert_equal expected.gsub(%r{[\r\n\t]}, ''), format(text).gsub(%r{[\r\n\t]}, '').rstrip + end + private def assert_section_with_hash(expected, text, index) |