');
@@ -37,7 +57,35 @@ main() {
// Note: There is no ordering. It is who ever comes off the wire first!
expect(log.result()).toEqual('LOG; SIMPLE');
}));
+ }));
+
+ it('should load a CSS file into a style', inject((MockHttp $http, Compiler $compile, Scope $rootScope, Log log) {
+ $http.expectGET('simple.html', '
Simple!
');
+
+ var element = $('
ignore');
+ $compile(element)(element)..attach($rootScope);
+
+ $http.flush().then(expectAsync1((data) {
+ expect(renderedText(element)).toEqual('@import "simple.css"Simple!');
+ expect(element[0].nodes[0].shadowRoot.innerHtml).toEqual(
+ '
Simple!
'
+ );
+ // Note: There is no ordering. It is who ever comes off the wire first!
+ expect(log.result()).toEqual('LOG; SIMPLE');
+ }));
+ }));
+
+ it('should load a CSS file with a \$template', inject((Compiler $compile, Scope $rootScope) {
+ var element = $('
ignore');
+ $compile(element)(element)..attach($rootScope);
+ expect(renderedText(element)).toEqual('@import "simple.css"inline!');
+ }));
+
+ it('should load a CSS with no template', inject((Compiler $compile, Scope $rootScope) {
+ var element = $('
ignore');
+ $compile(element)(element)..attach($rootScope);
+ expect(renderedText(element)).toEqual('@import "simple.css"');
}));
});
}