-
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.
fix: don't call detectChanges when fixture is destroyed (#57)
- Loading branch information
1 parent
6989a66
commit e41c034
Showing
3 changed files
with
47 additions
and
9 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
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,20 @@ | ||
import { Component } from '@angular/core'; | ||
import { render } from '../src/public_api'; | ||
|
||
@Component({ | ||
selector: 'fixture', | ||
template: ` | ||
<input type="text" data-testid="input" /> | ||
`, | ||
}) | ||
class FixtureComponent {} | ||
|
||
test('does not call detect changes when fixture is destroyed', async () => { | ||
const component = await render(FixtureComponent); | ||
|
||
component.fixture.destroy(); | ||
|
||
// should otherwise throw | ||
component.input(component.getByTestId('input'), { target: { value: 'Bonjour' } }); | ||
component.type(component.getByTestId('input'), 'Alles klar'); | ||
}); |