fix(ci): parse errors, two leaky tests and the lint ratchets after the parity round

This commit is contained in:
Maurice
2026-10-22 12:44:07 +02:00
parent 8d4d3423ff
commit 76c7323e23
22 changed files with 128 additions and 87 deletions
@@ -11,7 +11,7 @@ import type { AiStatusResponse } from '@trek/shared';
import { useLocation } from 'react-router';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { act, fireEvent, render, screen, waitFor } from '../../../tests/helpers/render';
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';
@@ -104,6 +104,9 @@ beforeEach(() => {
});
afterEach(() => {
// Unmounted before the store gets its real actions back: a window still on screen would ask the real
// loadStatus, whose failed request lands in a later case and hides the assistant there (status null).
cleanup();
useAssistantStore.setState(INITIAL, true);
vi.restoreAllMocks();
vi.clearAllMocks();
@@ -200,6 +200,6 @@ export function useAiConnections({ phone = false }: { phone?: boolean } = {}) {
canOpen: status?.available === true,
openAssistant,
isAdmin,
openAdmin: () => navigate('/admin?tab=addons'),
openAdmin: () => void navigate('/admin?tab=addons'),
};
}