diff options
| author | Andres Ornelas | 2010-08-06 17:28:47 -0700 |
|---|---|---|
| committer | Andres Ornelas | 2010-08-06 17:28:47 -0700 |
| commit | de8d0984c85ae3078fd72a9c7f010b0fd4397150 (patch) | |
| tree | 9f3310082e85c5f29c926474001a4f55af69df50 /test/scenario/DSLSpec.js | |
| parent | 989cffb43502744ab05baa741420c2082f137d69 (diff) | |
| download | angular.js-de8d0984c85ae3078fd72a9c7f010b0fd4397150.tar.bz2 | |
added repeater.collect to E2E DSL
Diffstat (limited to 'test/scenario/DSLSpec.js')
| -rw-r--r-- | test/scenario/DSLSpec.js | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/test/scenario/DSLSpec.js b/test/scenario/DSLSpec.js index 47bedb80..64961e50 100644 --- a/test/scenario/DSLSpec.js +++ b/test/scenario/DSLSpec.js @@ -42,16 +42,41 @@ describe("DSL", function() { var repeater = angular.scenario.dsl.repeater; - it('should fetch the count of repeated elements', function() { + it('should count', function() { var future = repeater('.repeater-row').count(); expect(future.name).toEqual("repeater '.repeater-row' count"); - executeFuture(future, "<div class='repeater-row'>a</div>" + - "<div class='repeater-row'>b</div>", - function(value) { - future.fulfill(value); + executeFuture(future, + "<div class='repeater-row'>a</div>" + + "<div class='repeater-row'>b</div>", + function(value) { + future.fulfill(value); }); expect(future.fulfilled).toBeTruthy(); expect(future.value).toEqual(2); }); + + it('should collect', function() { + var future = repeater('.epic').collect(); + expect(future.name).toEqual("repeater '.epic' collect"); + executeFuture(future, + "<table>" + + "<tr class='epic'>" + + "<td ng:bind='hero'>John Marston</td>" + + "<td ng:bind='game'>Red Dead Redemption</td>" + + "</tr>" + + "<tr class='epic'>" + + "<td ng:bind='hero'>Nathan Drake</td>" + + "<td ng:bind='game'>Uncharted 2</td>" + + "</tr>" + + "</table>", + function(value) { + future.fulfill(value); + }); + expect(future.fulfilled).toBeTruthy(); + expect(future.value[0].boundTo('hero')).toEqual('John Marston'); + expect(future.value[0].boundTo('game')).toEqual('Red Dead Redemption'); + expect(future.value[1].boundTo('hero')).toEqual('Nathan Drake'); + expect(future.value[1].boundTo('game')).toEqual('Uncharted 2'); + }); }); }); |
