mirror of
https://github.com/discourse/discourse.git
synced 2025-05-11 12:03:07 +08:00

* First take on subsetting svg icons * FontAwesome 5 svg subset WIP * Include icons from plugins/badges into svg sprite subset * add svg icon support to themes * Add spec for SvgSprite * Misc. SVG icon fixes * Use FA5 svgs in local-dates plugin * CSS adjustments, fix SVG icons in group flair * Use SVG icons in poll plugin * Add SVG icons to /wizard
65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
import { moduleForWidget, widgetTest } from "helpers/widget-test";
|
|
moduleForWidget("discourse-poll-option");
|
|
|
|
const template = `{{mount-widget
|
|
widget="discourse-poll-option"
|
|
args=(hash option=option isMultiple=isMultiple vote=vote)}}`;
|
|
|
|
widgetTest("single, not selected", {
|
|
template,
|
|
|
|
beforeEach() {
|
|
this.set("option", { id: "opt-id" });
|
|
this.set("vote", []);
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(find("li .d-icon-far-circle:eq(0)").length === 1);
|
|
}
|
|
});
|
|
|
|
widgetTest("single, selected", {
|
|
template,
|
|
|
|
beforeEach() {
|
|
this.set("option", { id: "opt-id" });
|
|
this.set("vote", ["opt-id"]);
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(find("li .d-icon-far-dot-circle:eq(0)").length === 1);
|
|
}
|
|
});
|
|
|
|
widgetTest("multi, not selected", {
|
|
template,
|
|
|
|
beforeEach() {
|
|
this.setProperties({
|
|
option: { id: "opt-id" },
|
|
isMultiple: true,
|
|
vote: []
|
|
});
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(find("li .d-icon-far-square:eq(0)").length === 1);
|
|
}
|
|
});
|
|
|
|
widgetTest("multi, selected", {
|
|
template,
|
|
|
|
beforeEach() {
|
|
this.setProperties({
|
|
option: { id: "opt-id" },
|
|
isMultiple: true,
|
|
vote: ["opt-id"]
|
|
});
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(find("li .d-icon-far-check-square:eq(0)").length === 1);
|
|
}
|
|
});
|