mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: Handle deprecations correctly in server-side pretty-text (#25059)
`window.deprecationWorkflow` does not exist in the server-side pretty-text environment. This commit fixes the check and adds a general spec for deprecations triggered inside pretty-text
This commit is contained in:
@ -2681,4 +2681,16 @@ HTML
|
||||
|
||||
expect(cooked.strip).to eq(html.strip)
|
||||
end
|
||||
|
||||
it "handles deprecations correctly" do
|
||||
Rails
|
||||
.logger
|
||||
.expects(:warn)
|
||||
.once
|
||||
.with("[PrettyText] Deprecation notice: Some deprecation message")
|
||||
|
||||
PrettyText.v8.eval <<~JS
|
||||
require("discourse-common/lib/deprecated").default("Some deprecation message");
|
||||
JS
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user