diff options
| author | Julie | 2014-01-11 16:59:15 -0800 | 
|---|---|---|
| committer | Caitlin Potter | 2014-01-28 14:14:20 -0500 | 
| commit | 7aef2d54e0a48fae18a289813f699962d8310565 (patch) | |
| tree | 60d1d559510c17e879aff798f298e6bcc262d3ab /src/ng/directive/ngRepeat.js | |
| parent | ce37ae28687167f7b4274ba547f013980126a219 (diff) | |
| download | angular.js-7aef2d54e0a48fae18a289813f699962d8310565.tar.bz2 | |
test(docs): convert example end to end doc tests from scenario runner to protractor
Thanks to jeffbcross, petebacondarwin, btford, jdeboer, tbosch for contributions!
Closes #6023
Diffstat (limited to 'src/ng/directive/ngRepeat.js')
| -rw-r--r-- | src/ng/directive/ngRepeat.js | 32 | 
1 files changed, 17 insertions, 15 deletions
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 43db58ba..e819877c 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -172,25 +172,27 @@          max-height:40px;        }      </file> -    <file name="scenario.js"> -       it('should render initial data set', function() { -         var r = using('.doc-example-live').repeater('ul li'); -         expect(r.count()).toBe(10); -         expect(r.row(0)).toEqual(["1","John","25"]); -         expect(r.row(1)).toEqual(["2","Jessie","30"]); -         expect(r.row(9)).toEqual(["10","Samantha","60"]); -         expect(binding('friends.length')).toBe("10"); -       }); +    <file name="protractorTest.js"> +      var friends = element(by.css('.doc-example-live')) +          .element.all(by.repeater('friend in friends')); + +      it('should render initial data set', function() { +        expect(friends.count()).toBe(10); +        expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.'); +        expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.'); +        expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.'); +        expect(element(by.binding('friends.length')).getText()) +            .toMatch("I have 10 friends. They are:"); +      });         it('should update repeater when filter predicate changes', function() { -         var r = using('.doc-example-live').repeater('ul li'); -         expect(r.count()).toBe(10); +         expect(friends.count()).toBe(10); -         input('q').enter('ma'); +         element(by.css('.doc-example-live')).element(by.model('q')).sendKeys('ma'); -         expect(r.count()).toBe(2); -         expect(r.row(0)).toEqual(["1","Mary","28"]); -         expect(r.row(1)).toEqual(["2","Samantha","60"]); +         expect(friends.count()).toBe(2); +         expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.'); +         expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');         });        </file>      </example>  | 
