diff options
| author | Misko Hevery | 2012-02-09 14:39:44 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2012-02-21 22:46:01 -0800 | 
| commit | 7bd69d0f5b1dd9aa04ac19393991566785ec81c2 (patch) | |
| tree | bfca161f26bc72bd740ed9e5c399e6c5e8f2d96f /test/widgetsSpec.js | |
| parent | 3773323e464bf45eed8cc70082ab369507d4e14d (diff) | |
| download | angular.js-7bd69d0f5b1dd9aa04ac19393991566785ec81c2.tar.bz2 | |
chore(ng:switch): rewritten with transclusion API
BREAKING CHANGE: the change event fires on scope of switch not on scope of case.
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 4cad31ad..65ab59e5 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -10,12 +10,13 @@ describe('widget', function() {    describe('ng:switch', function() {      it('should switch on value change', inject(function($rootScope, $compile) {        element = $compile( -        '<ng:switch on="select">' + +        '<div ng-switch="select">' +            '<div ng:switch-when="1">first:{{name}}</div>' +            '<div ng:switch-when="2">second:{{name}}</div>' +            '<div ng:switch-when="true">true:{{name}}</div>' + -        '</ng:switch>')($rootScope); -      expect(element.html()).toEqual(''); +        '</div>')($rootScope); +      expect(element.html()).toEqual( +          '<!-- ngSwitchWhen: 1 --><!-- ngSwitchWhen: 2 --><!-- ngSwitchWhen: true -->');        $rootScope.select = 1;        $rootScope.$apply();        expect(element.text()).toEqual('first:'); @@ -55,7 +56,7 @@ describe('widget', function() {          '</ng:switch>')($rootScope);        $rootScope.url = 'a';        $rootScope.$apply(); -      expect($rootScope.name).toEqual(undefined); +      expect($rootScope.name).toEqual('works');        expect(element.text()).toEqual('works');      }));    }); | 
