mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
test(studio): the assistant column's tests give the thread's viewport the scrolling jsdom lacks
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* journey; the bar's switch and the column it opens.
|
||||
*/
|
||||
import type { AiStatusResponse } from '@trek/shared';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { fireEvent, render, screen, waitFor, within } from '../../../tests/helpers/render';
|
||||
import { aiConnectionsRepo } from '../../repo/aiConnectionsRepo';
|
||||
@@ -55,6 +55,11 @@ function running() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
beforeAll(() => {
|
||||
// jsdom lays nothing out and has no element scrolling; the thread's viewport only needs the call to exist.
|
||||
Element.prototype.scrollTo = vi.fn() as unknown as typeof Element.prototype.scrollTo;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.spyOn(assistantRepo, 'threads').mockResolvedValue([]);
|
||||
useAssistantStore.setState({ ...INITIAL, status: STATUS, byTrip: {}, studioHosts: {} });
|
||||
|
||||
Reference in New Issue
Block a user