From f952d6a4b1d710977bacbe639cfd64605c112474 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 3 Sep 2024 11:36:52 +0200 Subject: [PATCH] chore: fix unit test --- .../autocomplete-textarea.component.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 3fe8f4a4..29dabac7 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -133,7 +133,6 @@ export class AutocompleteTextareaComponent private transliterationService: TransliterationService, private emojiInputService: EmojiInputService, private customTemplatesService: CustomTemplatesService, - private themeService: ThemeService, private cdRef: ChangeDetectorRef ) { this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => { @@ -200,7 +199,7 @@ export class AutocompleteTextareaComponent } if (changes.value && !this.value && this.messageInput) { this.messageInput.nativeElement.style.height = 'auto'; - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', '[Autocomplete textarea] Value reset, adjusting textarea height to auto' ); @@ -211,7 +210,7 @@ export class AutocompleteTextareaComponent this.messageInput && this.isViewInited ) { - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', '[Autocomplete textarea] Value changed' ); @@ -225,7 +224,7 @@ export class AutocompleteTextareaComponent ngAfterViewInit(): void { this.isViewInited = true; - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', '[Autocomplete textarea] View inited' ); @@ -263,7 +262,7 @@ export class AutocompleteTextareaComponent inputChanged() { this.valueChange.emit(this.messageInput.nativeElement.value); - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', '[Autocomplete textarea] Input changed' ); @@ -285,12 +284,12 @@ export class AutocompleteTextareaComponent private adjustTextareaHeight() { const necessaryHeight = `${this.messageInput.nativeElement.scrollHeight}px`; if (this.messageInput.nativeElement.style.height === necessaryHeight) { - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', `[Autocomplete textarea] No need to adjust textarea height` ); } else { - this.chatClientService.chatClient.logger( + this.chatClientService?.chatClient?.logger?.( 'info', `[Autocomplete textarea] Adjusting textarea height to ${necessaryHeight}` );