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

Commit 5792423

Browse files
committed
fix(tests): Correct tests for IE11
Some tests were wrong. However, src/* did not contain problems. Fixes #5046
1 parent c42d0a0 commit 5792423

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

test/ng/compileSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ describe('$compile', function() {
596596
expect(element).toHaveClass('class_2');
597597
}));
598598

599-
if (!msie || msie > 10) {
600-
// style interpolation not working on IE<11.
599+
if (!msie || msie > 11) {
600+
// style interpolation not working on IE (including IE11).
601601
it('should handle interpolated css style from replacing directive', inject(
602602
function($compile, $rootScope) {
603603
element = $compile('<div replace-with-interpolated-style></div>')($rootScope);

test/ng/snifferSpec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,11 @@ describe('$sniffer', function() {
334334
});
335335
});
336336

337-
it('should return true for msie when internet explorer is being used', inject(function($sniffer) {
338-
expect($sniffer.msie > 0).toBe(window.navigator.appName == 'Microsoft Internet Explorer');
337+
it('should return the internal msie flag', inject(function($sniffer) {
338+
expect(isNaN($sniffer.msie)).toBe(isNaN(msie));
339+
if (msie) {
340+
expect($sniffer.msie).toBe(msie);
341+
}
339342
}));
340343

341344
it('should return document.documentMode as msieDocumentMode', function() {

test/ngMock/angular-mocksSpec.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
'use strict';
22

3-
var msie = +((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
4-
53
describe('ngMock', function() {
64
var noop = angular.noop;
75

8-
96
describe('TzDate', function() {
107

118
function minutes(min) {
@@ -686,10 +683,10 @@ describe('ngMock', function() {
686683
expect(d($rootScope)).toMatch(/{"abc":"123"}/);
687684
}));
688685

689-
it('should serialize scope that has overridden "hasOwnProperty"', inject(function($rootScope){
686+
it('should serialize scope that has overridden "hasOwnProperty"', inject(function($rootScope, $sniffer){
690687
// MS IE8 just doesn't work for this kind of thing, since "for ... in" doesn't return
691688
// things like hasOwnProperty even if it is explicitly defined on the actual object!
692-
if (msie<=8) return;
689+
if ($sniffer.msie<=8) return;
693690
$rootScope.hasOwnProperty = 'X';
694691
expect(d($rootScope)).toMatch(/Scope\(.*\): \{/);
695692
expect(d($rootScope)).toMatch(/hasOwnProperty: "X"/);

0 commit comments

Comments
 (0)