This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
139 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>sawpf</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,55 @@ | ||
Cookie.unset('__sawpf_'); | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)'); | ||
document['documentMode'] = 5; | ||
require('/src/1.0.js'); | ||
|
||
describe('Internet Explorer 8.0/9.0 com user-agent do IE7 por causa do compatibility mode', function() { | ||
it('should not show sawpf bar', function() { | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
describe('Compatibility mode:', function() { | ||
|
||
describe('using IE7 on IE8', function() { | ||
it('should show sawpf bar', function() { | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)'); | ||
document.documentMode = 7; | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).toExist(); | ||
}) | ||
}); | ||
}); | ||
|
||
describe('using IE7 on IE9', function() { | ||
it('should not show sawpf bar', function() { | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)'); | ||
document.documentMode = 7; | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('using IE8 on IE9', function() { | ||
it('should not show sawpf bar', function() { | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/5.0)'); | ||
document.documentMode = 8; | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('using IE7 on IE10', function() { | ||
it('should not show sawpf bar', function() { | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/6.0)'); | ||
document.documentMode = 7; | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('using IE8 on IE10', function() { | ||
it('should not show sawpf bar', function() { | ||
fakeUserAgent('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/6.0)'); | ||
document.documentMode = 8; | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Cookie.unset('__sawpf_'); | ||
|
||
describe('IE10 should not show with user agent', function() { | ||
|
||
var userAgents = [ | ||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', | ||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)', | ||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)', | ||
'Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)', | ||
'Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)', | ||
'Mozilla/1.22 (compatible; MSIE 10.0; Windows 3.1)', | ||
'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0' | ||
]; | ||
|
||
for(var i=0; i<userAgents.length; i++) { | ||
var u = userAgents[i]; | ||
it(u, function() { | ||
fakeUserAgent(u); | ||
afterSawpfLoaded(function(){ | ||
expect(document.getElementById('sawpf')).not.toExist(); | ||
}) | ||
}); | ||
}; | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3ec2889
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! Thanks