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

Unified Diff: third_party/pkg/angular/test/directive/ng_base_css_spec.dart

Issue 257423008: 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, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/test/directive/ng_base_css_spec.dart
diff --git a/third_party/pkg/angular/test/directive/ng_base_css_spec.dart b/third_party/pkg/angular/test/directive/ng_base_css_spec.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4944b876047e25bb9e03b0fe0b2ed5542cfa5b10
--- /dev/null
+++ b/third_party/pkg/angular/test/directive/ng_base_css_spec.dart
@@ -0,0 +1,76 @@
+library ng_base_css_spec;
+
+import '../_specs.dart';
+
+@Component(
+ selector: 'html-and-css',
+ templateUrl: 'simple.html',
+ cssUrl: 'simple.css')
+class _HtmlAndCssComponent {}
+
+main() => describe('NgBaseCss', () {
+ beforeEachModule((Module module) {
+ module
+ ..type(_HtmlAndCssComponent);
+ });
+
+ it('should load css urls from ng-base-css', async((TestBed _, MockHttpBackend backend) {
+ backend
+ ..expectGET('base.css').respond(200, '.base{}')
+ ..expectGET('simple.css').respond(200, '.simple{}')
+ ..expectGET('simple.html').respond(200, '<div>Simple!</div>');
+
+ var element = e('<div ng-base-css="base.css"><html-and-css>ignore</html-and-css></div>');
+ _.compile(element);
+
+ microLeap();
+ backend.flush();
+ microLeap();
+
+ expect(element.children[0].shadowRoot).toHaveHtml(
+ '<style>.base{}</style><style>.simple{}</style><div>Simple!</div>'
+ );
+ }));
+
+ it('ng-base-css should overwrite parent ng-base-csses', async((TestBed _, MockHttpBackend backend) {
+ backend
+ ..expectGET('base.css').respond(200, '.base{}')
+ ..expectGET('simple.css').respond(200, '.simple{}')
+ ..expectGET('simple.html').respond(200, '<div>Simple!</div>');
+
+ var element = e('<div ng-base-css="hidden.css"><div ng-base-css="base.css"><html-and-css>ignore</html-and-css></div></div>');
+ _.compile(element);
+
+ microLeap();
+ backend.flush();
+ microLeap();
+
+ expect(element.children[0].children[0].shadowRoot).toHaveHtml(
+ '<style>.base{}</style><style>.simple{}</style><div>Simple!</div>'
+ );
+ }));
+
+ describe('from injector', () {
+ beforeEachModule((Module module) {
+ module.value(NgBaseCss, new NgBaseCss()..urls = ['injected.css']);
+ });
+
+ it('ng-base-css should be available from the injector', async((TestBed _, MockHttpBackend backend) {
+ backend
+ ..expectGET('injected.css').respond(200, '.injected{}')
+ ..expectGET('simple.css').respond(200, '.simple{}')
+ ..expectGET('simple.html').respond(200, '<div>Simple!</div>');
+
+ var element = e('<div><html-and-css>ignore</html-and-css></div></div>');
+ _.compile(element);
+
+ microLeap();
+ backend.flush();
+ microLeap();
+
+ expect(element.children[0].shadowRoot).toHaveHtml(
+ '<style>.injected{}</style><style>.simple{}</style><div>Simple!</div>'
+ );
+ }));
+ });
+});
« no previous file with comments | « third_party/pkg/angular/test/directive/ng_a_spec.dart ('k') | third_party/pkg/angular/test/directive/ng_bind_html_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698