( fixture: ComponentFixture<unknown>, cssContentMatcher: string, )
| 407 | }); |
| 408 | |
| 409 | async function styleCount( |
| 410 | fixture: ComponentFixture<unknown>, |
| 411 | cssContentMatcher: string, |
| 412 | ): Promise<number> { |
| 413 | // flush |
| 414 | await new Promise<void>((resolve) => { |
| 415 | setTimeout(() => resolve(), 0); |
| 416 | }); |
| 417 | |
| 418 | const html = fixture.debugElement.parent?.parent; |
| 419 | const debugElements = html?.queryAll(By.css('style')); |
| 420 | |
| 421 | if (!debugElements) { |
| 422 | return 0; |
| 423 | } |
| 424 | |
| 425 | return debugElements.filter(({nativeElement}) => |
| 426 | nativeElement.textContent.includes(cssContentMatcher), |
| 427 | ).length; |
| 428 | } |
| 429 | |
| 430 | @Component({ |
| 431 | selector: 'cmp-emulated', |
no test coverage detected
searching dependent graphs…