( options?: T, )
| 35 | * `result` accessor plus `flush` (runs change detection) and `destroy`. |
| 36 | */ |
| 37 | export function renderInjectChat<T extends InjectChatOptions>( |
| 38 | options?: T, |
| 39 | ): { |
| 40 | result: InjectChatResult |
| 41 | flush: () => void |
| 42 | destroy: () => void |
| 43 | } { |
| 44 | @Component({ standalone: true, template: '' }) |
| 45 | class HostComponent { |
| 46 | chat = injectChat(options as any) |
| 47 | } |
| 48 | |
| 49 | const fixture = TestBed.createComponent(HostComponent) |
| 50 | fixture.detectChanges() |
| 51 | |
| 52 | return { |
| 53 | get result() { |
| 54 | return fixture.componentInstance.chat |
| 55 | }, |
| 56 | flush: () => fixture.detectChanges(), |
| 57 | destroy: () => fixture.destroy(), |
| 58 | } |
| 59 | } |
no test coverage detected