diff --git a/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.spec.ts b/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.spec.ts index 78e7a7d4..8c182a0a 100644 --- a/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.spec.ts +++ b/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.spec.ts @@ -615,9 +615,11 @@ describe('LogbookItemComponent', () => { }}; component.editorRef = {nativeElement: {offsetHeight: t.input[1]}}; const updateViewHeightsSpy = spyOn(component, 'updateViewHeights').and.callFake(() => true); + const isMobileSpy = spyOn(component, 'isMobile').and.callThrough(); if (i === 3) window.innerWidth = 10; component.onResized(); expect(updateViewHeightsSpy).toHaveBeenCalledTimes(t.output); + expect(isMobileSpy).toHaveBeenCalledTimes(1); expect(component.mobile).toEqual(i === 3); }) }) diff --git a/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.ts b/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.ts index e24057da..fc7bdf60 100644 --- a/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.ts +++ b/scilog/src/app/logbook/widgets/logbook-item/logbook-item.component.ts @@ -685,10 +685,10 @@ export class LogbookItemComponent implements OnInit { onResized() { const _heightRef = this.snippetContainerRef.nativeElement.parentElement.parentElement.parentElement.parentElement.offsetHeight; const _editorHeight = this.editorRef?.nativeElement?.offsetHeight; + this.isMobile(); if (this._snippetHeightRef != _heightRef || this._editorHeightRef != _editorHeight) { this._snippetHeightRef = _heightRef; this._editorHeightRef = _editorHeight; - this.isMobile(); this.updateViewHeights(); } }