Skip to content

Commit

Permalink
Merge pull request #66 from blimmer/feature/additional-integration-tests
Browse files Browse the repository at this point in the history
Additional dom testing events.
  • Loading branch information
rwjblue committed Aug 19, 2015
2 parents 27a173c + a05722e commit 5f06790
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/test-module-for-integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,41 @@ test('it supports DOM events', function() {
equal(this.$('.value').text(), '1');
});

test('it supports updating an input', function() {
setResolverRegistry({
'component:my-input': Ember.TextField.extend({
value: null
})
});
this.render('{{my-input value=value}}');
this.$('input').val('1').change();
equal(this.get('value'), '1');
});

test('it supports dom triggered focus events', function() {
setResolverRegistry({
'component:my-input': Ember.TextField.extend({
_onInit: Ember.on('init', function() {
this.set('value', 'init');
}),
focusIn: function() {
this.set('value', 'focusin');
},
focusOut: function() {
this.set('value', 'focusout');
}
})
});
this.render('{{my-input}}');
equal(this.$('input').val(), 'init');

this.$('input').trigger('focusin');
equal(this.$('input').val(), 'focusin');

this.$('input').trigger('focusout');
equal(this.$('input').val(), 'focusout');
});

moduleForComponent('Component Integration Tests: render during setup', {
integration: true,
beforeSetup: function() {
Expand Down

0 comments on commit 5f06790

Please sign in to comment.