Files
discourse/test/javascripts/components/d-icon-test.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
809 B
JavaScript
Raw Normal View History

2017-11-23 18:15:37 +01:00
import componentTest from "helpers/component-test";
moduleForComponent("d-icon", { integration: true });
componentTest("default", {
2020-07-20 15:13:49 -04:00
template: '<div class="test">{{d-icon "bars"}}</div>',
2017-11-23 18:15:37 +01:00
test(assert) {
2020-07-20 15:13:49 -04:00
const html = find(".test").html().trim();
2018-11-26 16:49:57 -05:00
assert.equal(
html,
'<svg class="fa d-icon d-icon-bars svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#bars"></use></svg>'
);
2017-11-23 18:15:37 +01:00
},
});
componentTest("with replacement", {
2020-07-20 15:13:49 -04:00
template: '<div class="test">{{d-icon "d-watching"}}</div>',
2017-11-23 18:15:37 +01:00
test(assert) {
2020-07-20 15:13:49 -04:00
const html = find(".test").html().trim();
2017-11-23 18:15:37 +01:00
assert.equal(
html,
2019-12-19 14:53:57 -05:00
'<svg class="fa d-icon d-icon-d-watching svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#discourse-bell-exclamation"></use></svg>'
2017-11-23 18:15:37 +01:00
);
},
});