Add tests for richtext table classes

This commit is contained in:
Andy Allan 2021-03-24 17:55:15 +00:00
parent 0bdc865d9f
commit 5d39bf8491

View file

@ -47,6 +47,11 @@ class RichTextTest < ActiveSupport::TestCase
assert_select "style", false assert_select "style", false
assert_select "p", /^foo *baz$/ assert_select "p", /^foo *baz$/
end end
r = RichText.new("html", "<table><tr><td>column</td></tr></table>")
assert_html r do
assert_select "table[class='table table-sm w-auto']"
end
end end
def test_html_to_text def test_html_to_text
@ -145,6 +150,11 @@ class RichTextTest < ActiveSupport::TestCase
assert_html r do assert_html r do
assert_select "pre", /^\s*foo bar baz\s*$/ assert_select "pre", /^\s*foo bar baz\s*$/
end end
r = RichText.new("markdown", "|column|column")
assert_html r do
assert_select "table[class='table table-sm w-auto']"
end
end end
def test_markdown_to_text def test_markdown_to_text