Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
test(datepicker): initialize $sniffer variable
Browse files Browse the repository at this point in the history
The uninitialized $sniffer variable causes the
changeInputValueTo function to fail in Chrome.
Also fixed issue where an ng-change test was failing
as the date selected was the same as the initialized
scope date (today's date).

Closes #3630
  • Loading branch information
RobJacobs committed May 13, 2015
1 parent ce3ef4c commit 21b2002
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datepicker/test/datepicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ describe('datepicker directive', function () {
describe('initially', function () {
beforeEach(inject(function(_$document_, _$sniffer_) {
$document = _$document_;
$sniffer = _$sniffer_;
$rootScope.isopen = true;
$rootScope.date = new Date('September 30, 2010 15:30:00');
var wrapElement = $compile('<div><input ng-model="date" datepicker-popup><div>')($rootScope);
Expand Down Expand Up @@ -1871,7 +1872,7 @@ describe('datepicker directive', function () {
describe('use with `ng-change` directive', function() {
beforeEach(inject(function() {
$rootScope.changeHandler = jasmine.createSpy('changeHandler');
$rootScope.date = new Date();
$rootScope.date = new Date('09/16/2010');
var wrapElement = $compile('<div><input ng-model="date" datepicker-popup ng-required="true" ng-change="changeHandler()"><div>')($rootScope);
$rootScope.$digest();
assignElements(wrapElement);
Expand Down

0 comments on commit 21b2002

Please sign in to comment.