| OLD | NEW |
| 1 library ng_switch_spec; | 1 library ng_switch_spec; |
| 2 | 2 |
| 3 import '../_specs.dart'; | 3 import '../_specs.dart'; |
| 4 | 4 |
| 5 main() => describe('ngSwitch', () { | 5 main() => describe('ngSwitch', () { |
| 6 TestBed _; | 6 TestBed _; |
| 7 | 7 |
| 8 beforeEach(inject((TestBed tb) => _ = tb)); | 8 beforeEach(inject((TestBed tb) => _ = tb)); |
| 9 | 9 |
| 10 it('should switch on value change', inject(() { | 10 it('should switch on value change', inject(() { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 _.rootScope.name = 'works'; | 183 _.rootScope.name = 'works'; |
| 184 _.rootScope.$apply(); | 184 _.rootScope.$apply(); |
| 185 var child1 = getChildScope(); | 185 var child1 = getChildScope(); |
| 186 expect(child1).toBeNotNull(); | 186 expect(child1).toBeNotNull(); |
| 187 expect(element.text).toEqual('works'); | 187 expect(element.text).toEqual('works'); |
| 188 var destroyListener = jasmine.createSpy('watch listener'); | 188 var destroyListener = jasmine.createSpy('watch listener'); |
| 189 var listenerRemove = child1.$on('\$destroy', destroyListener); | 189 var listenerRemove = child1.$on('\$destroy', destroyListener); |
| 190 | 190 |
| 191 _.rootScope.url = 'x'; | 191 _.rootScope.url = 'x'; |
| 192 _.rootScope.$apply(); | 192 _.rootScope.$apply(); |
| 193 print(element); | |
| 194 print(getChildScope()); | |
| 195 expect(getChildScope()).toBeNull(); | 193 expect(getChildScope()).toBeNull(); |
| 196 expect(destroyListener).toHaveBeenCalledOnce(); | 194 expect(destroyListener).toHaveBeenCalledOnce(); |
| 197 listenerRemove(); | 195 listenerRemove(); |
| 198 | 196 |
| 199 _.rootScope.url = 'a'; | 197 _.rootScope.url = 'a'; |
| 200 _.rootScope.$apply(); | 198 _.rootScope.$apply(); |
| 201 var child2 = getChildScope(); | 199 var child2 = getChildScope(); |
| 202 expect(child2).toBeDefined(); | 200 expect(child2).toBeDefined(); |
| 203 expect(child2).not.toBe(child1); | 201 expect(child2).not.toBe(child1); |
| 204 })); | 202 })); |
| 205 }); | 203 }); |
| OLD | NEW |