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

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

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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(inject((TestBed tb) => _ = tb)); 9 beforeEach(inject((TestBed tb) => _ = tb));
10 10
11 it('should fetch template from literal url', async(inject((Scope scope, Temp lateCache 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.applyInZone(() { 19 scope.$apply(() {
20 scope.context['name'] = 'Vojta'; 20 scope['name'] = 'Vojta';
21 }); 21 });
22 expect(element.text).toEqual('my name is Vojta'); 22 expect(element.text).toEqual('my name is Vojta');
23 }))); 23 })));
24 24
25 it('should fetch template from url using interpolation', async(inject((Scope scope, TemplateCache cache) { 25 it('should fetch template from url using interpolation', async(inject((Scope scope, TemplateCache cache) {
26 cache.put('tpl1.html', new HttpResponse(200, 'My name is {{name}}')); 26 cache.put('tpl1.html', new HttpResponse(200, 'My name is {{name}}'));
27 cache.put('tpl2.html', new HttpResponse(200, 'I am {{name}}')); 27 cache.put('tpl2.html', new HttpResponse(200, 'I am {{name}}'));
28 28
29 var element = _.compile('<div ng-include="{{template}}"></div>'); 29 var element = _.compile('<div ng-include="{{template}}"></div>');
30 30
31 expect(element.innerHtml).toEqual(''); 31 expect(element.innerHtml).toEqual('');
32 32
33 scope.applyInZone(() { 33 scope.$apply(() {
34 scope.context['name'] = 'Vojta'; 34 scope['name'] = 'Vojta';
35 scope.context['template'] = 'tpl1.html'; 35 scope['template'] = 'tpl1.html';
36 }); 36 });
37 expect(element.text).toEqual('My name is Vojta'); 37 expect(element.text).toEqual('My name is Vojta');
38 38
39 scope.applyInZone(() { 39 scope.$apply(() {
40 scope.context['template'] = 'tpl2.html'; 40 scope['template'] = 'tpl2.html';
41 }); 41 });
42 expect(element.text).toEqual('I am Vojta'); 42 expect(element.text).toEqual('I am Vojta');
43 }))); 43 })));
44 44
45 }); 45 });
46 } 46 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/test/directive/ng_if_spec.dart ('k') | third_party/pkg/angular/test/directive/ng_model_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698