Skip to content

Commit 21b2002

Browse files
committed
test(datepicker): initialize $sniffer variable
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 angular-ui#3630
1 parent ce3ef4c commit 21b2002

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datepicker/test/datepicker.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ describe('datepicker directive', function () {
11781178
describe('initially', function () {
11791179
beforeEach(inject(function(_$document_, _$sniffer_) {
11801180
$document = _$document_;
1181+
$sniffer = _$sniffer_;
11811182
$rootScope.isopen = true;
11821183
$rootScope.date = new Date('September 30, 2010 15:30:00');
11831184
var wrapElement = $compile('<div><input ng-model="date" datepicker-popup><div>')($rootScope);
@@ -1871,7 +1872,7 @@ describe('datepicker directive', function () {
18711872
describe('use with `ng-change` directive', function() {
18721873
beforeEach(inject(function() {
18731874
$rootScope.changeHandler = jasmine.createSpy('changeHandler');
1874-
$rootScope.date = new Date();
1875+
$rootScope.date = new Date('09/16/2010');
18751876
var wrapElement = $compile('<div><input ng-model="date" datepicker-popup ng-required="true" ng-change="changeHandler()"><div>')($rootScope);
18761877
$rootScope.$digest();
18771878
assignElements(wrapElement);

0 commit comments

Comments
 (0)