forked from help-me-mom/ng-mocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(root): ignore signal-based queries
closes help-me-mom#8634
- Loading branch information
1 parent
5c98e73
commit 6f6b616
Showing
3 changed files
with
58 additions
and
5 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,47 @@ | ||
import { | ||
Component, | ||
ElementRef, | ||
Input, | ||
contentChild, | ||
input, | ||
viewChild, | ||
} from '@angular/core'; | ||
import { MockBuilder, MockRender } from 'ng-mocks'; | ||
|
||
@Component({ | ||
selector: 'app-nested', | ||
standalone: true, | ||
template: `<div #meow>Nested content</div>`, | ||
}) | ||
class NestedComponent { | ||
public readonly meowV = viewChild<ElementRef>('meow'); | ||
public readonly meowC = contentChild<ElementRef>('meow'); | ||
|
||
public readonly name = input.required<string>(); | ||
} | ||
|
||
@Component({ | ||
selector: 'app-target', | ||
standalone: true, | ||
imports: [NestedComponent], | ||
template: ` | ||
<app-nested></app-nested> | ||
<div>name: {{ name }}</div> | ||
`, | ||
}) | ||
class TargetComponent { | ||
@Input() public readonly name: string = ''; | ||
} | ||
|
||
describe('my sandbox', () => { | ||
beforeEach(() => MockBuilder(TargetComponent)); | ||
|
||
it('should do something', () => { | ||
const fixture = MockRender(TargetComponent, { | ||
name: 'sandbox', | ||
}); | ||
expect(fixture.nativeElement.innerHTML).toContain( | ||
'name: sandbox', | ||
); | ||
}); | ||
}); |