Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit eeb583c

Browse files
committed
test(*): exclude tests that are only failing on Edge
1 parent 344afc8 commit eeb583c

File tree

2 files changed

+57
-41
lines changed

2 files changed

+57
-41
lines changed

test/ng/animateRunnerSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ describe('$$AnimateRunner', function() {
329329
expect(status).toBe(true);
330330
}));
331331

332-
it('should break the chian when a function evaluates to false',
332+
it('should break the chain when a function evaluates to false',
333333
inject(function($$rAF, $$AnimateRunner) {
334334

335335
var runner1 = new $$AnimateRunner();

test/ng/directive/inputSpec.js

+56-40
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
describe('input', function() {
66
var helper = {}, $compile, $rootScope, $browser, $sniffer, $timeout, $q;
77

8+
// UA sniffing to exclude Edge from some date input tests
9+
var isEdge = /\bEdge\//.test(window.navigator.userAgent);
10+
811
generateInputCompilerHelper(helper);
912

1013
beforeEach(inject(function(_$compile_, _$rootScope_, _$browser_, _$sniffer_, _$timeout_, _$q_) {
@@ -688,18 +691,20 @@ describe('input', function() {
688691
expect($rootScope.form.alias.$error.month).toBeTruthy();
689692
});
690693

691-
it('should allow four or more digits in year', function() {
692-
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');
693694

694-
helper.changeInputValueTo('10123-03');
695-
expect(+$rootScope.value).toBe(Date.UTC(10123, 2, 1, 0, 0, 0));
695+
if (!isEdge) {
696+
it('should allow four or more digits in year', function() {
697+
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');
696698

697-
$rootScope.$apply(function() {
698-
$rootScope.value = new Date(Date.UTC(20456, 3, 1, 0, 0, 0));
699-
});
700-
expect(inputElm.val()).toBe('20456-04');
701-
});
699+
helper.changeInputValueTo('10123-03');
700+
expect(+$rootScope.value).toBe(Date.UTC(10123, 2, 1, 0, 0, 0));
702701

702+
$rootScope.$apply(function() {
703+
$rootScope.value = new Date(Date.UTC(20456, 3, 1, 0, 0, 0));
704+
});
705+
expect(inputElm.val()).toBe('20456-04');
706+
});
707+
}
703708

704709
it('should only change the month of a bound date', function() {
705710
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
@@ -899,17 +904,19 @@ describe('input', function() {
899904
expect(inputElm).toBeValid();
900905
});
901906

902-
it('should allow four or more digits in year', function() {
903-
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');
907+
if (!isEdge) {
908+
it('should allow four or more digits in year', function() {
909+
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');
904910

905-
helper.changeInputValueTo('10123-W03');
906-
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 21));
911+
helper.changeInputValueTo('10123-W03');
912+
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 21));
907913

908-
$rootScope.$apply(function() {
909-
$rootScope.value = new Date(Date.UTC(20456, 0, 28));
914+
$rootScope.$apply(function() {
915+
$rootScope.value = new Date(Date.UTC(20456, 0, 28));
916+
});
917+
expect(inputElm.val()).toBe('20456-W04');
910918
});
911-
expect(inputElm.val()).toBe('20456-W04');
912-
});
919+
}
913920

914921
it('should use UTC if specified in the options', function() {
915922
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
@@ -1195,18 +1202,22 @@ describe('input', function() {
11951202
expect(+$rootScope.value).toBe(+new Date(2000, 0, 1, 1, 2, 0));
11961203
});
11971204

1198-
it('should allow four or more digits in year', function() {
1199-
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="value" />');
12001205

1201-
helper.changeInputValueTo('10123-01-01T01:02');
1202-
expect(+$rootScope.value).toBe(+new Date(10123, 0, 1, 1, 2, 0));
1206+
if (!isEdge) {
1207+
it('should allow four or more digits in year', function() {
1208+
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="value" />');
1209+
1210+
helper.changeInputValueTo('10123-01-01T01:02');
1211+
expect(+$rootScope.value).toBe(+new Date(10123, 0, 1, 1, 2, 0));
1212+
1213+
$rootScope.$apply(function() {
1214+
$rootScope.value = new Date(20456, 1, 1, 1, 2, 0);
1215+
});
1216+
expect(inputElm.val()).toBe('20456-02-01T01:02:00.000');
1217+
}
1218+
);
1219+
}
12031220

1204-
$rootScope.$apply(function() {
1205-
$rootScope.value = new Date(20456, 1, 1, 1, 2, 0);
1206-
});
1207-
expect(inputElm.val()).toBe('20456-02-01T01:02:00.000');
1208-
}
1209-
);
12101221

12111222
it('should label parse errors as `datetimelocal`', function() {
12121223
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="val" name="alias" />', {
@@ -1800,19 +1811,20 @@ describe('input', function() {
18001811
}
18011812
);
18021813

1803-
it('should allow four or more digits in year', function() {
1804-
var inputElm = helper.compileInput('<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
1805-
1806-
helper.changeInputValueTo('10123-01-01');
1807-
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 1, 0, 0, 0));
1814+
if (!isEdge) {
1815+
it('should allow four or more digits in year', function() {
1816+
var inputElm = helper.compileInput('<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
18081817

1809-
$rootScope.$apply(function() {
1810-
$rootScope.value = new Date(Date.UTC(20456, 1, 1, 0, 0, 0));
1811-
});
1812-
expect(inputElm.val()).toBe('20456-02-01');
1813-
}
1814-
);
1818+
helper.changeInputValueTo('10123-01-01');
1819+
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 1, 0, 0, 0));
18151820

1821+
$rootScope.$apply(function() {
1822+
$rootScope.value = new Date(Date.UTC(20456, 1, 1, 0, 0, 0));
1823+
});
1824+
expect(inputElm.val()).toBe('20456-02-01');
1825+
}
1826+
);
1827+
}
18161828

18171829
it('should label parse errors as `date`', function() {
18181830
var inputElm = helper.compileInput('<input type="date" ng-model="val" name="alias" />', {
@@ -4224,10 +4236,14 @@ describe('input', function() {
42244236
});
42254237

42264238
expect(inputElm[0].value).toBe('');
4227-
// Support: IE 9-11
4239+
// Support: IE 9-11, Edge
42284240
// In IE it is not possible to remove the `value` attribute from an input element.
4229-
if (!msie) {
4241+
if (!msie && !isEdge) {
42304242
expect(inputElm[0].getAttribute('value')).toBeNull();
4243+
} else {
4244+
// Support: IE 9-11, Edge
4245+
// This will fail if the Edge bug gets fixed
4246+
expect(inputElm[0].getAttribute('value')).toBe('something');
42314247
}
42324248
});
42334249

0 commit comments

Comments
 (0)