This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,13 @@ void main() {
553
553
toBe (PublishModuleAttrDirective ._injector.get (PublishModuleDirectiveSuperType ));
554
554
});
555
555
556
+ it ('should expose PublishModuleDirectiveSuperType as PublishModuleDirectiveSuperType' , () {
557
+ _.compile (r'<div publish-types probe="publishModuleProbe"></div>' );
558
+ var probe = _.rootScope.context['publishModuleProbe' ];
559
+ var directive = probe.injector.get (PublishModuleDirectiveSuperType );
560
+ expect (directive is PublishModuleAttrDirective ).toBeTruthy ();
561
+ });
562
+
556
563
it ('should allow repeaters over controllers' , async ((Logger logger) {
557
564
_.compile (r'<log ng-repeat="i in [1, 2]"></log>' );
558
565
_.rootScope.apply ();
Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ void main() {
143
143
expect (form).toBeValid ();
144
144
});
145
145
146
+ it ('should expose NgForm as NgControl' , (Scope scope, TestBed _) {
147
+ _.compile ('<form name="myForm" probe="formProbe"><input type="text" /></form>' );
148
+ scope.apply ();
149
+
150
+ expect (scope.context['formProbe' ].injector.get (NgControl ) is NgForm ).toBeTruthy ();
151
+ });
152
+
146
153
it ('should add and remove the correct flags when set to valid and to invalid' ,
147
154
(Scope scope, TestBed _) {
148
155
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ main() {
43
43
.toEqual ('all' );
44
44
}));
45
45
46
+ it ('should expose NgBindRoute as RouteProvider' , async (() {
47
+ Element root = _.compile (
48
+ '<div ng-bind-route="library"><div probe="routeProbe"></div></div>' );
49
+ expect (_.rootScope.context['routeProbe' ].injector.get (RouteProvider ) is NgBindRoute ).toBeTruthy ();
50
+ }));
51
+
46
52
});
47
53
}
48
54
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ main() {
21
21
router = _router;
22
22
23
23
templates.put ('foo.html' , new HttpResponse (200 ,
24
- '<h1>Foo</h1>' ));
24
+ '<h1 probe="p" >Foo</h1>' ));
25
25
templates.put ('bar.html' , new HttpResponse (200 ,
26
- '<h1>Bar</h1>' ));
26
+ '<h1 probe="p" >Bar</h1>' ));
27
27
});
28
28
29
29
@@ -47,6 +47,15 @@ main() {
47
47
expect (root.text).toEqual ('Foo' );
48
48
}));
49
49
50
+ it ('should expose NgView as RouteProvider' , async (() {
51
+ _.compile ('<ng-view probe="m"></ng-view>' );
52
+ router.route ('/foo' );
53
+ microLeap ();
54
+ _.rootScope.apply ();
55
+
56
+ expect (_.rootScope.context['p' ].injector.get (RouteProvider ) is NgView ).toBeTruthy ();
57
+ }));
58
+
50
59
51
60
it ('should switch template when route is already active' , async (() {
52
61
// Force the routing system to initialize.
You can’t perform that action at this time.
0 commit comments