mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 06:56:20 +08:00
25 lines
608 B
JavaScript
25 lines
608 B
JavaScript
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"}}`,
|
|
|
|
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');
|
|
}
|
|
});
|