Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintcache

Large diffs are not rendered by default.

60 changes: 20 additions & 40 deletions bun.lock

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions failed-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ChatInterface renders chat messages
ChatInterface allows sending a new message
ChatInterface shows loading state when sending a message
ChatInterface displays error message when there is an error
ChatInterface allows switching models
ConversationSidebar displays list of conversations
ConversationSidebar calls onConversationSelect when a conversation is clicked
SettingsPanel renders provider selection
SettingsPanel allows switching providers
useIsMobile hook should handle window resize events
useToast hook useToast hook should dismiss toast when dismiss is called
useToast hook useToast hook should dismiss all toasts when no id is provided
useToast hook useToast hook should handle multiple toasts
useToast hook useToast hook should generate unique ids for each toast
useToast hook useToast hook should maintain toast order
mcpService discovery and prompt generation discovers both configured servers and builds a structured cached prompt
cn utility function should handle Tailwind class conflicts
ConversationSidebar shows loading state initially
ConversationSidebar shows empty state when no conversations exist
ConversationSidebar renders with correct width and styling
MCP Day Tool Integration should correctly answer what day tomorrow is
SettingsService loadSettings should load default settings when none exist
SettingsService loadSettings should handle invalid JSON gracefully
ConversationStateManager initialization should initialize successfully
ConversationStateManager initialization should handle initialization errors gracefully
ConversationStateManager state management should notify listeners of state changes
ConversationStateManager state management should provide readonly state access
ConversationStateManager conversation operations should create new conversations
ConversationStateManager conversation operations should load conversations by ID
ConversationStateManager conversation operations should archive and unarchive conversations
ConversationStateManager conversation operations should delete conversations
ConversationStateManager search and filtering should search conversations
ConversationUtils title generation should truncate long messages
StorageService conversation operations should truncate long titles appropriately
StorageService sanitization should remove API keys from messages
1 change: 1 addition & 0 deletions failure-report.clean.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions failure-report.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@types/supertest": "^6.0.3",
"@types/ws": "^8.18.1",
"@vitejs/plugin-react-swc": "^4.1.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/coverage-v8": "^4.0.12",
"@vitest/ui": "^3.2.4",
"autoprefixer": "^10.4.21",
"eslint": "^9.36.0",
Expand All @@ -109,7 +109,7 @@
"typescript": "^5.9.3",
"typescript-eslint": "^8.45.0",
"vite": "^7.1.9",
"vitest": "^3.2.4"
"vitest": "^4.0.12"
},
"test": {
"module": {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ChatInterface.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ vi.mock('@/hooks/use-settings', () => ({
})
}));

describe('ChatInterface', () => {
describe('ChatInterface', { tags: ['db'] }, () => {
beforeEach(() => {
vi.clearAllMocks();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/ConversationSidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mockConversations = [
}
];

describe('ConversationSidebar', () => {
describe('ConversationSidebar', { tags: ['db'] }, () => {
const onSelect = vi.fn();
const onNewConversation = vi.fn();
const onToggleArchive = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/SettingsPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const mockProviders = [
}
];

describe('SettingsPanel', () => {
describe('SettingsPanel', { tags: ['db'] }, () => {
const defaultProps = {
providers: mockProviders,
setProviders: vi.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/hooks/use-mobile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
import { renderHook } from '@testing-library/react'
import { useIsMobile } from '@/hooks/use-mobile'

describe('useIsMobile hook', () => {
describe('useIsMobile hook', { tags: ['db'] }, () => {
let originalInnerWidth: number
let matchMediaSpy: any

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/hooks/use-toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
import { renderHook, act } from '@testing-library/react'
import { useToast, toast } from '@/hooks/use-toast'

describe('useToast hook', () => {
describe('useToast hook', { tags: ['db'] }, () => {
beforeEach(() => {
// Clear any existing toasts
vi.clearAllMocks()
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/services/mcpService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
// Small helper to delay
const tick = (ms = 10) => new Promise(resolve => setTimeout(resolve, ms))

describe('mcpService discovery and prompt generation', () => {
describe('mcpService discovery and prompt generation', { tags: ['db'] }, () => {
beforeEach(() => {
// Reset module cache so each test gets a fresh mcpService instance
vi.resetModules()
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/utils/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest'
import { cn } from '@/lib/utils'

describe('cn utility function', () => {
describe('cn utility function', { tags: ['db'] }, () => {
it('should merge class names correctly', () => {
const result = cn('class1', 'class2', 'class3')
expect(result).toBe('class1 class2 class3')
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/ConversationSidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ vi.mock('@/hooks/use-toast', () => ({
}),
}));

describe('ConversationSidebar', () => {
describe('ConversationSidebar', { tags: ['db'] }, () => {
const mockConversation: Conversation = {
id: 'conv-1',
title: 'Test Conversation',
Expand Down
6 changes: 3 additions & 3 deletions src/services/__tests__/stateManagement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ vi.mock('../storage', () => ({
}))
}));

describe('SettingsService', () => {
describe('SettingsService', { tags: ['db'] }, () => {
let settingsService: SettingsService;

beforeEach(() => {
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('SettingsService', () => {
});
});

describe('ConversationStateManager', () => {
describe('ConversationStateManager', { tags: ['db'] }, () => {
let stateManager: ConversationStateManager;
let mockStorageService: any;

Expand Down Expand Up @@ -326,7 +326,7 @@ describe('ConversationStateManager', () => {
});
});

describe('ConversationUtils', () => {
describe('ConversationUtils', { tags: ['db'] }, () => {
describe('ID generation', () => {
it('should generate unique IDs', () => {
const id1 = ConversationUtils.generateId();
Expand Down
2 changes: 1 addition & 1 deletion src/services/__tests__/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vi.mock('fs', () => ({
}
}));

describe('StorageService', () => {
describe('StorageService', { tags: ['db'] }, () => {
let storageService: StorageService;
let mockConversation: Conversation;

Expand Down
2 changes: 1 addition & 1 deletion src/services/indexedDbStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class IndexedDbStorage {
// Methods that your conversation state manager expects
async listConversations(showArchived: boolean = false): Promise<Chat[]> {
try {
let query = this.db.chats.orderBy("lastModified").reverse();
const query = this.db.chats.orderBy("lastModified").reverse();
const chats = await query.toArray();

const convertedChats = chats.map((chat) =>
Expand Down
2 changes: 1 addition & 1 deletion src/services/settingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class SettingsService {
* Validate settings object
*/
private validateSettings(settings: any): AppSettings {
let validated: any = { ...this.DEFAULT_SETTINGS };
const validated: any = { ...this.DEFAULT_SETTINGS };

// Validate each setting with type checking
for (const [key, defaultValue] of Object.entries(this.DEFAULT_SETTINGS)) {
Expand Down
6 changes: 6 additions & 0 deletions src/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@testing-library/jest-dom'
import { vi } from 'vitest'
import 'fake-indexeddb/auto'

// Mock window.matchMedia for use-mobile hook
Object.defineProperty(window, 'matchMedia', {
Expand Down Expand Up @@ -33,6 +34,11 @@ global.IntersectionObserver = vi.fn().mockImplementation(() => ({
// Mock scrollIntoView
Element.prototype.scrollIntoView = vi.fn()

// Mock scrollTo (jsdom doesn't implement it)
if (typeof window !== 'undefined' && !(window as any).scrollTo) {
;(window as any).scrollTo = () => {}
}

// Mock getComputedStyle
Object.defineProperty(window, 'getComputedStyle', {
value: () => ({
Expand Down
Loading
Loading