mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't disable details when below truncate limit
This commit is contained in:
@@ -385,10 +385,14 @@ describe PrettyText do
|
||||
expect(PrettyText.excerpt("<span class='spoiler'>spoiler</div>", 100)).to match_html "<span class='spoiler'>spoiler</span>"
|
||||
end
|
||||
|
||||
it "should keep details" do
|
||||
it "should keep details if too long" do
|
||||
expect(PrettyText.excerpt("<details><summary>expand</summary><p>hello</p></details>", 30)).to match_html "<details class='disabled'><summary>expand</summary></details>"
|
||||
end
|
||||
|
||||
it "doesn't disable details if short enough" do
|
||||
expect(PrettyText.excerpt("<details><summary>expand</summary><p>hello</p></details>", 60)).to match_html "<details><summary>expand</summary>hello</details>"
|
||||
end
|
||||
|
||||
it "should remove meta informations" do
|
||||
expect(PrettyText.excerpt(wrapped_image, 100)).to match_html "<a href='//localhost:3000/uploads/default/4399/33691397e78b4d75.png' class='lightbox' title='Screen Shot 2014-04-14 at 9.47.10 PM.png'>[image]</a>"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user