-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
projects/testing-library/tests/issues/issue-422-view-already-destroyed.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, ElementRef } from '@angular/core'; | ||
import { NgIf } from '@angular/common'; | ||
import { render } from '../../src/public_api'; | ||
|
||
test('declaration specific dependencies should be available for components', async () => { | ||
@Component({ | ||
selector: 'atl-test', | ||
standalone: true, | ||
template: `<div>Test</div>`, | ||
}) | ||
class TestComponent { | ||
constructor(_elementRef: ElementRef) {} | ||
} | ||
|
||
await expect(async () => await render(TestComponent)).not.toThrow(); | ||
}); | ||
|
||
test('standalone directives imported in standalone components', async () => { | ||
@Component({ | ||
selector: 'atl-test', | ||
standalone: true, | ||
imports: [NgIf], | ||
template: `<div *ngIf="true">Test</div>`, | ||
}) | ||
class TestComponent {} | ||
|
||
await render(TestComponent); | ||
}); |