Update code so Ember 2.3 can have more tests passing

This commit is contained in:
Robin Ward
2016-11-08 13:40:35 -05:00
parent 78cd42943f
commit 151597bf0f
5 changed files with 46 additions and 20 deletions

View File

@ -1,17 +1,24 @@
moduleForComponent("text-field", {needs: []});
import componentTest from 'helpers/component-test';
test("renders correctly with no properties set", function() {
var component = this.subject();
equal(component.get('type'), "text");
moduleForComponent("text-field", { integration: true });
componentTest("renders correctly with no properties set", {
template: `{{text-field}}`,
test(assert) {
assert.ok(this.$('input[type=text]').length);
}
});
test("support a placeholder", function() {
sandbox.stub(I18n, "t").returnsArg(0);
componentTest("support a placeholder", {
template: `{{text-field placeholderKey="placeholder.i18n.key"}}`,
var component = this.subject({
placeholderKey: "placeholder.i18n.key"
});
setup() {
sandbox.stub(I18n, "t").returnsArg(0);
},
equal(component.get('type'), "text");
equal(component.get('placeholder'), "placeholder.i18n.key");
test(assert) {
assert.ok(this.$('input[type=text]').length);
assert.equal(this.$('input').prop('placeholder'), 'placeholder.i18n.key');
}
});