/** * FE-AI-WIN-001 to FE-AI-WIN-011 * * The desktop window around the chat: when it shows at all, the button it * opens from, the trip picker outside a trip, closing that keeps the chat, and * Escape, which stops an answer before it closes anything (and leaves the * header's menu to itself), and where the focus goes on the way. The geometry is * useDragResize's and has its own tests; here it is a fixed rect. */ import type { AiStatusResponse } from '@trek/shared'; import { useLocation } from 'react-router'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { act, cleanup, fireEvent, render, screen, waitFor } from '../../../tests/helpers/render'; import { tripRepo } from '../../repo/tripRepo'; import { chatOf, useAssistantStore } from '../../store/assistantStore'; import type { Trip } from '../../types'; import AssistantWindow from './AssistantWindow'; import type { EntityTarget } from './cards/cardTypes'; vi.mock('../../hooks/useDragResize', () => ({ useDragResize: () => ({ rect: { x: 600, y: 120, width: 400, height: 600 }, active: false, handleProps: {}, edgeProps: () => ({}), onKeyDown: () => {}, }), })); vi.mock('./AssistantSurfaceLazy', () => ({ default: ({ tripId, tripTitle, density, onFocusDay, onOpen, }: { tripId: number; tripTitle: string; density?: string; onFocusDay?: (dayId: number) => void; onOpen?: (target: EntityTarget) => void; }) => (

chat {tripId} {tripTitle}

{density} {onFocusDay && ( )} {onOpen && ( <> )}