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

Side by Side Diff: third_party/pkg/angular/test/introspection_spec.dart

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 introspection_spec; 1 library introspection_spec;
2 2
3 import '_specs.dart'; 3 import '_specs.dart';
4 4
5 main() => describe('introspection', () { 5 main() => describe('introspection', () {
6 it('should retrieve ElementProbe', inject((TestBed _) { 6 it('should retrieve ElementProbe', inject((TestBed _) {
7 _.compile('<div ng-bind="true"></div>'); 7 _.compile('<div ng-bind="true"></div>');
8 ElementProbe probe = ngProbe(_.rootElement); 8 ElementProbe probe = ngProbe(_.rootElement);
9 expect(probe.injector.parent).toBe(_.injector); 9 expect(probe.injector.parent).toBe(_.injector);
10 expect(ngInjector(_.rootElement).parent).toBe(_.injector); 10 expect(ngInjector(_.rootElement).parent).toBe(_.injector);
11 expect(probe.directives[0] is NgBindDirective).toBe(true); 11 expect(probe.directives[0] is NgBindDirective).toBe(true);
12 expect(ngDirectives(_.rootElement)[0] is NgBindDirective).toBe(true); 12 expect(ngDirectives(_.rootElement)[0] is NgBindDirective).toBe(true);
13 expect(probe.scope).toBe(_.rootScope); 13 expect(probe.scope).toBe(_.rootScope);
14 expect(ngScope(_.rootElement)).toBe(_.rootScope); 14 expect(ngScope(_.rootElement)).toBe(_.rootScope);
15 })); 15 }));
16 16
17 toHtml(List list) => list.map((e) => e.outerHtml).join(''); 17 toHtml(List list) => list.map((e) => e.outerHtml).join('');
18 18
19 it('should select elements using CSS selector', () { 19 it('should select elements using CSS selector', () {
20 var div = new Element.html('<div><p><span></span></p></div>'); 20 var div = new Element.html('<div><p><span></span></p></div>');
21 var span = div.querySelector('span'); 21 var span = div.querySelector('span');
22 var shadowRoot = span.createShadowRoot(); 22 var shadowRoot = span.createShadowRoot();
23 shadowRoot.innerHtml = '<ul><li>stash</li><li>secret</li><ul>'; 23 shadowRoot.innerHtml = '<ul><li>stash</li><li>secret</li><ul>';
24 24
25 expect(toHtml(ngQuery(div, 'li'))).toEqual('<li>stash</li><li>secret</li>'); 25 expect(toHtml(ngQuery(div, 'li'))).toEqual('<li>stash</li><li>secret</li>');
26 expect(toHtml(ngQuery(div, 'li', 'stash'))).toEqual('<li>stash</li>'); 26 expect(toHtml(ngQuery(div, 'li', 'stash'))).toEqual('<li>stash</li>');
27 expect(toHtml(ngQuery(div, 'li', 'secret'))).toEqual('<li>secret</li>'); 27 expect(toHtml(ngQuery(div, 'li', 'secret'))).toEqual('<li>secret</li>');
28 expect(toHtml(ngQuery(div, 'li', 'xxx'))).toEqual(''); 28 expect(toHtml(ngQuery(div, 'li', 'xxx'))).toEqual('');
29 }); 29 });
30
31 it('should select elements in the root shadow root', () {
32 var div = new Element.html('<div></div>');
33 var shadowRoot = div.createShadowRoot();
34 shadowRoot.innerHtml = '<ul><li>stash</li><li>secret</li><ul>';
35 expect(toHtml(ngQuery(div, 'li'))).toEqual('<li>stash</li><li>secret</li>');
36 });
30 }); 37 });
OLDNEW
« no previous file with comments | « third_party/pkg/angular/test/directive/ng_switch_spec.dart ('k') | third_party/pkg/angular/test/mock/http_backend_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698