Skip to content

Commit

Permalink
chore(test): add missing test for ng-change
Browse files Browse the repository at this point in the history
Closes# 399
  • Loading branch information
mhevery committed Feb 5, 2014
1 parent 478d336 commit 1ab385e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/directive/input_select_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,27 @@ main() {
expect(element).toEqualSelect(['not me', ['me!'], 'nah']);
});

it('should fire ng-change event.', () {
var log = '';
compile(
'<select name="select" ng-model="selection" ng-change="change()">' +
'<option value=""></option>' +
'<option value="c">C</option>' +
'</select>');

scope.change = () {
log += 'change:${scope.selection};';
};

scope.$apply(() {
scope.selection = 'c';
});

element.value = 'c';
_.triggerEvent(element, 'change');
expect(log).toEqual('change:c;');
});


xit('should require', () {
compile(
Expand Down

0 comments on commit 1ab385e

Please sign in to comment.