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

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

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
(Empty)
1 library ng_template_spec;
2
3 import '../_specs.dart';
4
5 main() {
6 describe('NgTemplateDirective', () {
7 TestBed _;
8 var element;
9
10 they(should, htmlForElements, callback) {
11 htmlForElements.forEach((html) {
12 var tagName = html.contains('<template') ? 'template' : 'script';
13 describe('$tagName[type="text/ng-template"]', () {
14 beforeEach(inject((TestBed tb) => _ = tb));
15 it(should, () {
16 element = $(html);
17 inject(callback);
18 });
19 });
20 });
21 }
22
23 they('should populate TemplateCache with contents of a ng-template template element',
24 [ // <template>
25 '<div>foo' +
26 '<template id="/ignore">ignore me</template>' +
27 '<template type="text/ng-template" id="/myTemplate.html"><x>{{y}}</x>< /template>' +
28 '</div>',
29 // <script>
30 '<div>foo' +
31 '<script id="/ignore">ignore me</script>' +
32 '<script type="text/ng-template" id="/myTemplate.html"><x>{{y}}</x></s cript>' +
33 '</div>'],
34 (Injector injector, Compiler compiler, TemplateCache templateCache, Direct iveMap directives) {
35 compiler(element, directives)(injector, element);
36 expect(templateCache.get('/ignore')).toBeNull();
37 expect(templateCache.get('/myTemplate.html').responseText).toEqual('<x>{ {y}}</x>');
38 }
39 );
40
41 they('should not compile template elements',
42 [ // <template>
43 '<div>foo' +
44 '<template type="text/javascript">some {{binding}} <div></div></templa te>' +
45 '<template type="text/ng-template" id="/some">other {{binding}} <div>< /div></template>' +
46 '</div>',
47 // <script>
48 '<div>foo' +
49 '<script type="text/javascript">some {{binding}} <div></div></script>' +
50 '<script type="text/ng-template" id="/some">other {{binding}} <div></d iv></script>' +
51 '</div>'],
52 (Injector injector, Compiler compiler, TemplateCache templateCache, Scope scope, DirectiveMap directives) {
53 var templates = element.contents();
54 compiler(element, directives)(injector, element);
55
56 microLeap();
57 // This binding should have been left alone (i.e. not interpolated).
58 expect(templates[2].innerHtml).toEqual('other {{binding}} <div></div>');
59 }
60 );
61 });
62 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/test/directive/ng_switch_spec.dart ('k') | third_party/pkg/angular/test/filter/currency_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698