Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit e7a5f66

Browse files
leonsenftmatanlurey
authored andcommitted
Removes use of debug injector that required directive to have Visibility.all
PiperOrigin-RevId: 186557395
1 parent b67e727 commit e7a5f66

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

_tests/test/core/view/projection_integration_test.dart

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:angular/core.dart'
66
show Component, Directive, Input, ViewChild, ViewChildren, Visibility;
77
import 'package:angular/src/core/linker.dart'
88
show ElementRef, TemplateRef, ViewContainerRef;
9-
import 'package:angular/src/debug/debug_node.dart' show getAllDebugNodes;
109
import 'package:angular_test/angular_test.dart';
1110

1211
import 'projection_integration_test.template.dart' as ng_generated;
@@ -105,18 +104,10 @@ void main() {
105104
test('should support moving non projected light dom around', () async {
106105
var testBed = new NgTestBed<MoveLightDomTest>();
107106
var fixture = await testBed.create();
108-
109-
// Have to search for the directive because it's not in the DOM at all.
110-
ManualViewportDirective sourceDirective;
111-
getAllDebugNodes().forEach((debug) {
112-
if (debug.providerTokens.contains(ManualViewportDirective)) {
113-
sourceDirective = debug.inject(ManualViewportDirective);
114-
}
115-
});
116-
117107
expect(fixture.text, 'START()END');
118108
await fixture.update((MoveLightDomTest component) {
119-
component.projectDirective.show(sourceDirective.templateRef);
109+
component.projectDirective
110+
.show(component.manualViewportDirective.templateRef);
120111
});
121112
expect(fixture.text, 'START(A)END');
122113
});
@@ -415,10 +406,11 @@ class TextNodeAfterStyleComponent {
415406
'</empty>'
416407
'START(<div project></div>)END',
417408
directives: const [Empty, ProjectDirective, ManualViewportDirective],
418-
// TODO(b/71710685): Change to `Visibility.local` to reduce code size.
419-
visibility: Visibility.all,
420409
)
421410
class MoveLightDomTest {
411+
@ViewChild(ManualViewportDirective)
412+
ManualViewportDirective manualViewportDirective;
413+
422414
@ViewChild(ProjectDirective)
423415
ProjectDirective projectDirective;
424416
}

0 commit comments

Comments
 (0)