Skip to content

Instantly share code, notes, and snippets.

@tanqhnguyen
Created October 12, 2015 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanqhnguyen/52213f40ffa800153d90 to your computer and use it in GitHub Desktop.
Save tanqhnguyen/52213f40ffa800153d90 to your computer and use it in GitHub Desktop.
version-select.spec.js
describe('Watch input type', function() {
it('should update models when changed to gte type', function() {
$scope.form.input = ['1'];
compileDirective();
expect(ctrl.versionType).toBe('equal');
expect(ctrl.versionGteInput).toBe(null);
ctrl.versionType = 'gte';
$scope.$digest();
expect(ctrl.versionType).toBe('gte');
expect(ctrl.versionGteInput).toBe(null);
});
it('should update models when changed to equal type', function() {
$scope.form.gteInput = '1';
compileDirective();
expect(ctrl.versionType).toBe('gte');
expect(ctrl.versionInput).toEqual([]);
ctrl.versionType = 'equal';
$scope.$digest();
expect(ctrl.versionType).toBe('equal');
expect(ctrl.versionInput).toEqual([]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment