mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
DEV: Introduce theme-qunit system spec (#23389)
This was intended to be included as part of c7dce90f43
This commit is contained in:
parent
bf971b022d
commit
30fbfb0fbb
27
spec/system/theme_qunit_spec.rb
Normal file
27
spec/system/theme_qunit_spec.rb
Normal file
@ -0,0 +1,27 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Theme qunit testing", type: :system do
|
||||
let!(:theme_with_test) do
|
||||
t = Fabricate(:theme, name: "My Theme")
|
||||
t.set_field(target: :tests_js, type: :js, name: "acceptance/some-test.js", value: <<~JS)
|
||||
import { module, test } from "qunit";
|
||||
|
||||
module("theme test", function () {
|
||||
test("it works", function (assert) {
|
||||
assert.true(true)
|
||||
});
|
||||
});
|
||||
JS
|
||||
t.save!
|
||||
t
|
||||
end
|
||||
|
||||
it "can run theme tests correctly" do
|
||||
visit "/theme-qunit"
|
||||
|
||||
find("a[href=\"/theme-qunit?id=#{theme_with_test.id}\"]").click
|
||||
|
||||
success_count = find("#qunit-testresult-display .passed").text
|
||||
expect(success_count).to eq("1")
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user