-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cleanup components without id (#419)
Closes #398
- Loading branch information
1 parent
db551f6
commit 523b8fd
Showing
2 changed files
with
27 additions
and
0 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
24 changes: 24 additions & 0 deletions
24
projects/testing-library/tests/issues/issue-398-component-without-host-id.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,24 @@ | ||
import { Component } from '@angular/core'; | ||
import { render, screen } from '../../src/public_api'; | ||
|
||
test('should create the app', async () => { | ||
await render(FixtureComponent); | ||
expect(screen.getByRole('heading')).toBeInTheDocument(); | ||
}); | ||
|
||
test('should re-create the app', async () => { | ||
await render(FixtureComponent); | ||
expect(screen.getByRole('heading')).toBeInTheDocument(); | ||
}); | ||
|
||
@Component({ | ||
selector: 'atl-fixture', | ||
standalone: true, | ||
template: '<h1>My title</h1>', | ||
// eslint-disable-next-line @angular-eslint/no-host-metadata-property | ||
host: { | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
'[attr.id]': 'null', // this breaks the cleaning up of tests | ||
}, | ||
}) | ||
class FixtureComponent {} |