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

29 lines
589 B
Plaintext
Raw Normal View History

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