diff options
| author | Andres Ornelas | 2010-10-27 11:29:51 -0700 | 
|---|---|---|
| committer | Elliott Sprehn | 2010-10-28 15:21:02 -0700 | 
| commit | 34909520ae4b20ddf455adf72de8473e43cac1c6 (patch) | |
| tree | a574e06d513f341e93551d52f0010e60adb0143a /test | |
| parent | 92e31b556fcaeea7e7078c63729287dbdfcf09ff (diff) | |
| download | angular.js-34909520ae4b20ddf455adf72de8473e43cac1c6.tar.bz2 | |
add optional label to dsl with selectors to improve test and output readability
e.g.
Before:
   code:   element('.actions ul li a').click();
   output: element .actions ul li a click
After
   code:   element('.actions ul li a', "'Configuration' link").click();
   output: element 'Configuration' link ( .actions ul li a ) click
Diffstat (limited to 'test')
| -rw-r--r-- | test/scenario/dslSpec.js | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js index d21c1bb9..50d37961 100644 --- a/test/scenario/dslSpec.js +++ b/test/scenario/dslSpec.js @@ -222,6 +222,16 @@ describe("angular.scenario.dsl", function() {          });          expect($root.futureResult).toEqual('http://example.com/myUrl');        }); + +      it('should use the selector as label if none is given', function() { +        $root.dsl.element('mySelector'); +        expect($root.label).toEqual(' mySelector'); +      }); + +      it('should include the selector in paren when a label is given', function() { +        $root.dsl.element('mySelector', 'myLabel'); +        expect($root.label).toEqual('myLabel ( mySelector )'); +      });      });      describe('Repeater', function() { @@ -256,6 +266,15 @@ describe("angular.scenario.dsl", function() {          chain.column('gender');          expect($root.futureResult).toEqual(['male', 'female']);        }); + +      it('should use the selector as label if none is given', function() { +        expect($root.label).toEqual(' ul li'); +      }); + +      it('should include the selector in paren when a label is given', function() { +        $root.dsl.repeater('mySelector', 'myLabel'); +        expect($root.label).toEqual('myLabel ( ul li mySelector )'); +      });      });      describe('Binding', function() { @@ -302,6 +321,17 @@ describe("angular.scenario.dsl", function() {          expect(inputs.first().val()).toEqual('something');          expect(inputs.last().val()).toEqual('foo');        }); + +      it('should use the selector as label if none is given', function() { +        $root.dsl.using('mySelector'); +        expect($root.label).toEqual(' mySelector'); +      }); + +      it('should include the selector in paren when a label is given', function() { +        $root.dsl.using('mySelector', 'myLabel'); +        expect($root.label).toEqual('myLabel ( mySelector )'); +      }); +      });      describe('Input', function() {  | 
