aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
diff options
context:
space:
mode:
authorIgor Minar2011-09-16 00:09:33 +0200
committerIgor Minar2011-09-16 02:44:35 +0200
commit3ace81b92ad00da73c89e7536ac7aa7c6681e30a (patch)
treedb2fc914f625a0f3acaf0392cc5318d4156ec48a /src/directives.js
parent9acf45127e96051e23f28af7650778fe444d8c86 (diff)
downloadangular.js-3ace81b92ad00da73c89e7536ac7aa7c6681e30a.tar.bz2
fix(e2e tests): use prop() instead of attr() and quote attributes
Because of changes in jQuery, we need to use element().prop() instead of element().attr() to retrieve className and other element properties. Additionally all attribute selectors (e.g. input[name=value]) must have value quoted if it contains dots (".").
Diffstat (limited to 'src/directives.js')
-rw-r--r--src/directives.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/directives.js b/src/directives.js
index 6d68ee4e..5a8dbafb 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -588,17 +588,17 @@ function ngClass(selector) {
</doc:source>
<doc:scenario>
it('should check ng:class', function(){
- expect(element('.doc-example-live span').attr('className')).not().
+ expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-input-indicator-wait/);
using('.doc-example-live').element(':button:first').click();
- expect(element('.doc-example-live span').attr('className')).
+ expect(element('.doc-example-live span').prop('className')).
toMatch(/ng-input-indicator-wait/);
using('.doc-example-live').element(':button:last').click();
- expect(element('.doc-example-live span').attr('className')).not().
+ expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-input-indicator-wait/);
});
</doc:scenario>
@@ -637,9 +637,9 @@ angularDirective("ng:class", ngClass(function(){return true;}));
</doc:source>
<doc:scenario>
it('should check ng:class-odd and ng:class-even', function(){
- expect(element('.doc-example-live li:first span').attr('className')).
+ expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
- expect(element('.doc-example-live li:last span').attr('className')).
+ expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/ng-input-indicator-wait/);
});
</doc:scenario>
@@ -678,9 +678,9 @@ angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;}));
</doc:source>
<doc:scenario>
it('should check ng:class-odd and ng:class-even', function(){
- expect(element('.doc-example-live li:first span').attr('className')).
+ expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
- expect(element('.doc-example-live li:last span').attr('className')).
+ expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/ng-input-indicator-wait/);
});
</doc:scenario>
@@ -796,7 +796,7 @@ angularDirective("ng:hide", function(expression, element){
it('should check ng:style', function(){
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
element('.doc-example-live :button[value=set]').click();
- expect(element('.doc-example-live span').css('color')).toBe('red');
+ expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');
element('.doc-example-live :button[value=clear]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
});