mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 19:35:09 +08:00
25 lines
603 B
JavaScript
25 lines
603 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"}}`,
|
|
|
|
setup() {
|
|
sandbox.stub(I18n, "t").returnsArg(0);
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(this.$('input[type=text]').length);
|
|
assert.equal(this.$('input').prop('placeholder'), 'placeholder.i18n.key');
|
|
}
|
|
});
|