diff options
| author | Vojta Jina | 2011-06-02 20:15:43 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-06-02 12:51:12 -0700 |
| commit | 9a6967755116f14b6f27fc00b5976b58f0bc6fcd (patch) | |
| tree | 18aaeaff178f7cb3dd8dd92917c2195b384f542e /test/directivesSpec.js | |
| parent | b6db58c6472002cd81821a106816398942d4d0a4 (diff) | |
| download | angular.js-9a6967755116f14b6f27fc00b5976b58f0bc6fcd.tar.bz2 | |
Fix CSS tests on Opera
Opera translates name colors to numbers (red -> #ff0000)
Other browsers like FF or Chrome translate number to rgb (#ff0000 -> rgb(255, 0, 0)
So avoiding colors in tests is probably the easiest solution...
Diffstat (limited to 'test/directivesSpec.js')
| -rw-r--r-- | test/directivesSpec.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 4b2e7055..e5b8b607 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -196,9 +196,9 @@ describe("directive", function(){ describe('ng:style', function(){ it('should set', function(){ - var scope = compile('<div ng:style="{color:\'red\'}"></div>'); + var scope = compile('<div ng:style="{height: \'40px\'}"></div>'); scope.$eval(); - expect(element.css('color')).toEqual('red'); + expect(element.css('height')).toEqual('40px'); }); it('should silently ignore undefined style', function() { @@ -208,15 +208,15 @@ describe("directive", function(){ }); it('should preserve and remove previous style', function(){ - var scope = compile('<div style="color:red;" ng:style="myStyle"></div>'); + var scope = compile('<div style="height: 10px;" ng:style="myStyle"></div>'); scope.$eval(); - expect(getStyle(element)).toEqual({color:'red'}); - scope.myStyle = {color:'blue', width:'10px'}; + expect(getStyle(element)).toEqual({height: '10px'}); + scope.myStyle = {height: '20px', width: '10px'}; scope.$eval(); - expect(getStyle(element)).toEqual({color:'blue', width:'10px'}); + expect(getStyle(element)).toEqual({height: '20px', width: '10px'}); scope.myStyle = {}; scope.$eval(); - expect(getStyle(element)).toEqual({color:'red'}); + expect(getStyle(element)).toEqual({height: '10px'}); }); }); |
