Skip to content

Commit

Permalink
chore: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Sep 3, 2024
1 parent 6d41ab1 commit f952d6a
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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'
);
Expand All @@ -211,7 +210,7 @@ export class AutocompleteTextareaComponent
this.messageInput &&
this.isViewInited
) {
this.chatClientService.chatClient.logger(
this.chatClientService?.chatClient?.logger?.(
'info',
'[Autocomplete textarea] Value changed'
);
Expand All @@ -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'
);
Expand Down Expand Up @@ -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'
);
Expand All @@ -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}`
);
Expand Down

0 comments on commit f952d6a

Please sign in to comment.