discourse/test/javascripts/components/text-field-test.js.es6

25 lines
608 B
Plaintext
Raw Normal View History

import componentTest from 'helpers/component-test';
moduleForComponent("text-field", { integration: true });
componentTest("renders correctly with no properties set", {
template: `{{text-field}}`,
test(assert) {
assert.ok(this.$('input[type=text]').length);
}
});
componentTest("support a placeholder", {
template: `{{text-field placeholderKey="placeholder.i18n.key"}}`,
2017-06-15 01:57:58 +08:00
beforeEach() {
sandbox.stub(I18n, "t").returnsArg(0);
},
test(assert) {
assert.ok(this.$('input[type=text]').length);
assert.equal(this.$('input').prop('placeholder'), 'placeholder.i18n.key');
}
});