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

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

Issue 124053002: Adding Angular and dependent packages for testing (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
(Empty)
1 library introspection_spec;
2
3 import '_specs.dart';
4
5 main() => describe('introspection', () {
6 it('should retrieve ElementProbe', inject((TestBed _) {
7 _.compile('<div ng-bind="true"></div>');
8 ElementProbe probe = ngProbe(_.rootElement);
9 expect(probe.injector.parent).toBe(_.injector);
10 expect(ngInjector(_.rootElement).parent).toBe(_.injector);
11 expect(probe.directives[0] is NgBindDirective).toBe(true);
12 expect(ngDirectives(_.rootElement)[0] is NgBindDirective).toBe(true);
13 expect(probe.scope).toBe(_.rootScope);
14 expect(ngScope(_.rootElement)).toBe(_.rootScope);
15 }));
16
17 toHtml(List list) => list.map((e) => e.outerHtml).join('');
18
19 it('should select elements using CSS selector', () {
20 var div = new Element.html('<div><p><span></span></p></div>');
21 var span = div.querySelector('span');
22 var shadowRoot = span.createShadowRoot();
23 shadowRoot.innerHtml = '<ul><li>stash</li><li>secret</li><ul>';
24
25 expect(toHtml(ngQuery(div, 'li'))).toEqual('<li>stash</li><li>secret</li>');
26 expect(toHtml(ngQuery(div, 'li', 'stash'))).toEqual('<li>stash</li>');
27 expect(toHtml(ngQuery(div, 'li', 'secret'))).toEqual('<li>secret</li>');
28 expect(toHtml(ngQuery(div, 'li', 'xxx'))).toEqual('');
29 });
30 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698