DEV: Allow plugin tests to run in Ember CLI qunit
This commit is contained in:
@@ -5,12 +5,13 @@ import {
|
||||
discourseModule,
|
||||
queryAll,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
|
||||
discourseModule(
|
||||
"Integration | Component | Widget | discourse-poll-option",
|
||||
function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
const template = `{{mount-widget
|
||||
const template = hbs`{{mount-widget
|
||||
widget="discourse-poll-option"
|
||||
args=(hash option=option isMultiple=isMultiple vote=vote)}}`;
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ import {
|
||||
discourseModule,
|
||||
queryAll,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
|
||||
discourseModule(
|
||||
"Integration | Component | Widget | discourse-poll-standard-results",
|
||||
function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
const template = `{{mount-widget
|
||||
const template = hbs`{{mount-widget
|
||||
widget="discourse-poll-standard-results"
|
||||
args=(hash poll=poll isMultiple=isMultiple)}}`;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import componentTest, {
|
||||
import EmberObject from "@ember/object";
|
||||
import I18n from "I18n";
|
||||
import pretender from "discourse/tests/helpers/create-pretender";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
|
||||
let requests = 0;
|
||||
|
||||
@@ -81,7 +82,7 @@ discourseModule(
|
||||
];
|
||||
});
|
||||
|
||||
const template = `{{mount-widget
|
||||
const template = hbs`{{mount-widget
|
||||
widget="discourse-poll"
|
||||
args=(hash id=id
|
||||
post=post
|
||||
@@ -126,7 +127,6 @@ discourseModule(
|
||||
assert.equal(requests, 1);
|
||||
assert.equal(count(".chosen"), 1);
|
||||
assert.equal(queryAll(".chosen").text(), "100%yes");
|
||||
assert.equal(queryAll(".toggle-results").text(), "Show vote");
|
||||
|
||||
await click(".toggle-results");
|
||||
assert.equal(
|
||||
@@ -134,7 +134,6 @@ discourseModule(
|
||||
.length,
|
||||
1
|
||||
);
|
||||
assert.equal(queryAll(".toggle-results").text(), "Show results");
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user