Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
<fix>(transformers): Fix template_cache_generator_spec
Browse files Browse the repository at this point in the history
Add template_cache_generator_spec to the test suite in that directory, and fix the included tests.
  • Loading branch information
Ted Sander authored and rkirov committed Mar 19, 2015
1 parent f9406a4 commit 16e8e14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions test/tools/transformer/all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import 'expression_generator_spec.dart' as expression_generator_spec;
import 'metadata_generator_spec.dart' as metadata_generator_spec;
import 'static_angular_generator_spec.dart' as static_angular_generator_spec;
import 'type_relative_uri_generator_spec.dart' as type_relative_uri_generator_spec;
import 'template_cache_generator_spec.dart' as template_cache_generator_spec;

main() {
expression_generator_spec.main();
metadata_generator_spec.main();
static_angular_generator_spec.main();
type_relative_uri_generator_spec.main();
template_cache_generator_spec.main();
}
30 changes: 15 additions & 15 deletions test/tools/transformer/template_cache_generator_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ main() {
describe('TemplateCacheGenerator', () {
var htmlContent1 = "<div></div>";
var htmlContent2 = "<span></span>";
var cssContent1 = '#id {color: red}';
var cssContent2 = '#id2 {color: blue}';

it('should cache templateURL', () {
return generates(setupPhases(),
Expand All @@ -33,19 +35,17 @@ main() {
@Component(templateUrl: "test2.html")
class B {}
''',
'a|test1.html': htmlContent1,
'a|test2.html': htmlContent2,
'a|web/test1.html': htmlContent1,
'a|web/dir/test2.html': htmlContent2,
'angular|lib/angular.dart': libAngular,
},
cacheContent: {
'test1.html': htmlContent1,
'test2.html': htmlContent2,
'dir/test2.html': htmlContent2,
});
});

it('should cache cssURLs', () {
var cssContent1 = '#id {color: red}';
var cssContent2 = '#id2 {color: blue}';
return generates(setupPhases(),
inputs: {
'a|web/main.dart': '''
Expand All @@ -63,13 +63,13 @@ main() {
@Component(cssUrl: ["test2.css"])
class B {}
''',
'a|test1.css': cssContent1,
'a|test2.css': cssContent2,
'a|web/test1.css': cssContent1,
'a|web/dir/test2.css': cssContent2,
'angular|lib/angular.dart': libAngular,
},
cacheContent: {
'test1.css': cssContent1,
'test2.css': cssContent2,
'dir/test2.css': cssContent2,
});
});

Expand All @@ -93,8 +93,8 @@ main() {
main() {}
''',
'a|multiline1.html': multiLineContent1,
'a|multiline2.css': multiLineContent2,
'a|web/multiline1.html': multiLineContent1,
'a|web/multiline2.css': multiLineContent2,
'angular|lib/angular.dart': libAngular,
},
cacheContent: {
Expand Down Expand Up @@ -123,14 +123,14 @@ main() {
@NgTemplateCache(preCacheUrls: ["test2.html"])
class B {}
''',
'a|test1.html': htmlContent1,
'a|test2.html': htmlContent2,
'a|web/test1.html': htmlContent1,
'a|web/dir/test2.html': htmlContent2,
'angular|lib/angular.dart': libAngular,
'angular|lib/angular_cache.dart': libCacheAnnotation,
},
cacheContent: {
'test1.html': htmlContent1,
'test2.html': htmlContent2,
'dir/test2.html': htmlContent2,
});
});

Expand Down Expand Up @@ -181,8 +181,8 @@ main() {
@NgTemplateCache(preCacheUrls: ["test2.html"])
class B {}
''',
'angular|lib/angular.dart': libAngular,
'angular|lib/template_cache.dart': libCacheAnnotation,
'angular|lib/angular.dart': libAngular,
'angular|lib/template_cache.dart': libCacheAnnotation,
});
});
});
Expand Down

0 comments on commit 16e8e14

Please sign in to comment.