discourse/test/javascripts/widgets/avatar-flair-test.js.es6
Penar Musaraj 005e1ecb9b
FEATURE: Update Font Awesome to v5.4.1 and SVGs (#6557)
* 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
2018-11-07 13:05:43 -05:00

37 lines
1.1 KiB
JavaScript

import { moduleForWidget, widgetTest } from "helpers/widget-test";
moduleForWidget("avatar-flair");
widgetTest("avatar flair with an icon", {
template: '{{mount-widget widget="avatar-flair" args=args}}',
beforeEach() {
this.set("args", {
primary_group_flair_url: "fa-bars",
primary_group_flair_bg_color: "CC0000",
primary_group_flair_color: "FFFFFF"
});
},
test(assert) {
assert.ok(this.$(".avatar-flair").length, "it has the tag");
assert.ok(this.$("svg.d-icon-bars").length, "it has the svg icon");
assert.equal(
this.$(".avatar-flair").attr("style"),
"background-color: #CC0000; color: #FFFFFF; ",
"it has styles"
);
}
});
widgetTest("avatar flair with an image", {
template: '{{mount-widget widget="avatar-flair" args=args}}',
beforeEach() {
this.set("args", {
primary_group_flair_url: "/images/avatar.png"
});
},
test(assert) {
assert.ok(this.$(".avatar-flair").length, "it has the tag");
assert.ok(this.$("svg").length === 0, "it does not have an svg icon");
}
});