mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
FIX: Copy button JS test failures (#23687)
JS tests expect `show_copy_button_on_codeblocks` to be false (because default before #81f3f56 was false). There is probably a different issue at play here with JS tests, I haven't dug into it yet. Instead, this PR adds a system test to ensure copy button is present for code blocks with default site settings enabled.
This commit is contained in:
parent
6adc67a7a8
commit
ca394177cb
@ -8,6 +8,8 @@ module("Integration | Component | Widget | post-cooked", function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test("quotes with no username and no valid topic", async function (assert) {
|
||||
this.siteSettings.show_copy_button_on_codeblocks = false;
|
||||
|
||||
this.set("args", {
|
||||
cooked: `<aside class=\"quote no-group quote-post-not-found\" data-post=\"1\" data-topic=\"123456\">\n<blockquote>\n<p>abcd</p>\n</blockquote>\n</aside>\n<p>Testing the issue</p>`,
|
||||
});
|
||||
|
@ -33,4 +33,19 @@ describe "Topic page", type: :system do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with a post containing a code block" do
|
||||
before { Fabricate(:post, topic: topic, raw: <<~RAW) }
|
||||
this a code block
|
||||
```
|
||||
echo "hello world"
|
||||
```
|
||||
RAW
|
||||
|
||||
it "includes the copy button" do
|
||||
visit("/t/#{topic.slug}/#{topic.id}")
|
||||
|
||||
expect(".codeblock-button-wrapper").to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user