be-missing.md
March 2, 2024 · View on GitHub
🏠 → Documentation → Built-In Functionality → beMissing
Other Assertions: beFound ・ beMissing ・ containText ・ haveAttributes ・ haveCalled ・ haveCssClass ・ haveEmitted ・ haveState ・ haveStyle ・ haveText
This assertion checks if its associated target(s) are not to be found in the template of the component-under-test.
Signature
beMissing();
Example
class the {
static AdminPanel() {
return get(AdminPanelComponent);
}
}
it('should hide the admin-panel if the current user is no admin', () => {
When(host)
.has(state({ user: { role: 'user' } }))
.expect(the.AdminPanel)
.to(beMissing());
});