Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: third_party/pkg/angular/test/directive/ng_include_spec.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library ng_include_spec; 1 library ng_include_spec;
2 2
3 import '../_specs.dart'; 3 import '../_specs.dart';
4 4
5 main() { 5 main() {
6 describe('NgInclude', () { 6 describe('NgInclude', () {
7 TestBed _; 7 TestBed _;
8 8
9 beforeEach((TestBed tb) => _ = tb); 9 beforeEach(inject((TestBed tb) => _ = tb));
10 10
11 it('should fetch template from literal url', async((Scope scope, TemplateCac he cache) { 11 it('should fetch template from literal url', async(inject((Scope scope, Temp lateCache cache) {
12 cache.put('tpl.html', new HttpResponse(200, 'my name is {{name}}')); 12 cache.put('tpl.html', new HttpResponse(200, 'my name is {{name}}'));
13 13
14 var element = _.compile('<div ng-include="tpl.html"></div>'); 14 var element = _.compile('<div ng-include="tpl.html"></div>');
15 15
16 expect(element.innerHtml).toEqual(''); 16 expect(element.innerHtml).toEqual('');
17 17
18 microLeap(); // load the template from cache. 18 microLeap(); // load the template from cache.
19 scope.context['name'] = 'Vojta'; 19 scope.applyInZone(() {
20 scope.apply(); 20 scope.context['name'] = 'Vojta';
21 });
21 expect(element.text).toEqual('my name is Vojta'); 22 expect(element.text).toEqual('my name is Vojta');
22 })); 23 })));
23 24
24 it('should fetch template from url using interpolation', async((Scope scope, TemplateCache cache) { 25 it('should fetch template from url using interpolation', async(inject((Scope scope, TemplateCache cache) {
25 cache.put('tpl1.html', new HttpResponse(200, 'My name is {{name}}')); 26 cache.put('tpl1.html', new HttpResponse(200, 'My name is {{name}}'));
26 cache.put('tpl2.html', new HttpResponse(200, 'I am {{name}}')); 27 cache.put('tpl2.html', new HttpResponse(200, 'I am {{name}}'));
27 28
28 var element = _.compile('<div ng-include="{{template}}"></div>'); 29 var element = _.compile('<div ng-include="{{template}}"></div>');
29 30
30 expect(element.innerHtml).toEqual(''); 31 expect(element.innerHtml).toEqual('');
31 32
32 scope.context['name'] = 'Vojta'; 33 scope.applyInZone(() {
33 scope.context['template'] = 'tpl1.html'; 34 scope.context['name'] = 'Vojta';
34 microLeap(); 35 scope.context['template'] = 'tpl1.html';
35 scope.apply(); 36 });
36 microLeap();
37 scope.apply();
38 expect(element.text).toEqual('My name is Vojta'); 37 expect(element.text).toEqual('My name is Vojta');
39 38
40 scope.context['template'] = 'tpl2.html'; 39 scope.applyInZone(() {
41 microLeap(); 40 scope.context['template'] = 'tpl2.html';
42 scope.apply(); 41 });
43 microLeap();
44 scope.apply();
45 expect(element.text).toEqual('I am Vojta'); 42 expect(element.text).toEqual('I am Vojta');
46 })); 43 })));
47 44
48 }); 45 });
49 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698