discourse/test/javascripts/components/d-icon-test.js.es6

29 lines
589 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import componentTest from "helpers/component-test";
2017-11-24 01:15:37 +08:00
2018-06-15 23:03:24 +08:00
moduleForComponent("d-icon", { integration: true });
2017-11-24 01:15:37 +08:00
2018-06-15 23:03:24 +08:00
componentTest("default", {
2017-11-24 01:15:37 +08:00
template: '{{d-icon "bars"}}',
test(assert) {
2018-06-15 23:03:24 +08:00
const html = this.$()
.html()
.trim();
assert.equal(html, '<i class="fa fa-bars d-icon d-icon-bars"></i>');
2017-11-24 01:15:37 +08:00
}
});
2018-06-15 23:03:24 +08:00
componentTest("with replacement", {
2017-11-24 01:15:37 +08:00
template: '{{d-icon "d-watching"}}',
test(assert) {
2018-06-15 23:03:24 +08:00
const html = this.$()
.html()
.trim();
assert.equal(
html,
'<i class="fa fa-exclamation-circle d-icon d-icon-d-watching"></i>'
2018-06-15 23:03:24 +08:00
);
2017-11-24 01:15:37 +08:00
}
});