| Index: third_party/pkg/angular/test/core/core_directive_spec.dart
|
| ===================================================================
|
| --- third_party/pkg/angular/test/core/core_directive_spec.dart (revision 33054)
|
| +++ third_party/pkg/angular/test/core/core_directive_spec.dart (working copy)
|
| @@ -5,7 +5,8 @@
|
| main() => describe('DirectiveMap', () {
|
|
|
| beforeEach(module((Module module) {
|
| - module..type(AnnotatedIoComponent);
|
| + module
|
| + ..type(AnnotatedIoComponent);
|
| }));
|
|
|
| it('should extract attr map from annotated component', inject((DirectiveMap directives) {
|
| @@ -20,6 +21,7 @@
|
| expect(annotation.publishTypes).toEqual([String]);
|
| expect(annotation.template).toEqual('template');
|
| expect(annotation.templateUrl).toEqual('templateUrl');
|
| + expect(annotation.cssUrl).toEqual('cssUrl');
|
| expect(annotation.cssUrls).toEqual(['cssUrls']);
|
| expect(annotation.applyAuthorStyles).toEqual(true);
|
| expect(annotation.resetStyleInheritance).toEqual(true);
|
| @@ -39,10 +41,10 @@
|
| describe('exceptions', () {
|
| it('should throw when annotation is for existing mapping', () {
|
| var module = new Module()
|
| - ..type(DirectiveMap)
|
| - ..type(Bad1Component)
|
| - ..type(MetadataExtractor)
|
| - ..type(FieldMetadataExtractor);
|
| + ..type(DirectiveMap)
|
| + ..type(Bad1Component)
|
| + ..type(MetadataExtractor)
|
| + ..type(FieldMetadataExtractor);
|
|
|
| var injector = new DynamicInjector(modules: [module]);
|
| expect(() {
|
| @@ -53,10 +55,10 @@
|
|
|
| it('should throw when annotated both getter and setter', () {
|
| var module = new Module()
|
| - ..type(DirectiveMap)
|
| - ..type(Bad2Component)
|
| - ..type(MetadataExtractor)
|
| - ..type(FieldMetadataExtractor);
|
| + ..type(DirectiveMap)
|
| + ..type(Bad2Component)
|
| + ..type(MetadataExtractor)
|
| + ..type(FieldMetadataExtractor);
|
|
|
| var injector = new DynamicInjector(modules: [module]);
|
| expect(() {
|
| @@ -71,7 +73,8 @@
|
| selector: 'annotated-io',
|
| template: 'template',
|
| templateUrl: 'templateUrl',
|
| - cssUrl: const ['cssUrls'],
|
| + cssUrl: 'cssUrl',
|
| + cssUrls: const ['cssUrls'],
|
| applyAuthorStyles: true,
|
| resetStyleInheritance: true,
|
| publishAs: 'ctrl',
|
| @@ -80,10 +83,11 @@
|
| exportExpressions: const ['exportExpressions'],
|
| map: const {
|
| 'foo': '=>foo'
|
| - })
|
| + }
|
| +)
|
| class AnnotatedIoComponent {
|
| AnnotatedIoComponent(Scope scope) {
|
| - scope.rootScope.context['ioComponent'] = this;
|
| + scope.$root.ioComponent = this;
|
| }
|
|
|
| @NgAttr('attr')
|
| @@ -114,7 +118,8 @@
|
| template: r'<content></content>',
|
| map: const {
|
| 'foo': '=>foo'
|
| - })
|
| + }
|
| +)
|
| class Bad1Component {
|
| @NgOneWay('foo')
|
| String foo;
|
| @@ -122,7 +127,8 @@
|
|
|
| @NgComponent(
|
| selector: 'bad2',
|
| - template: r'<content></content>')
|
| + template: r'<content></content>'
|
| +)
|
| class Bad2Component {
|
| @NgOneWay('foo')
|
| get foo => null;
|
|
|