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
2 changes: 1 addition & 1 deletion core/src/browser/extensions/conversational.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ describe('ConversationalExtension', () => {

expect(retrievedAssistant.modelId).toBe('')
})
})
})
2 changes: 1 addition & 1 deletion core/src/browser/extensions/engines/LocalOAIEngine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ describe('LocalOAIEngine', () => {
expect(engine.loadedModel).toBeUndefined()
})
})
})
})
2 changes: 1 addition & 1 deletion core/src/browser/extensions/mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ describe('MCPExtension', () => {
expect(healthy).toBe(true)
})
})
})
})
2 changes: 1 addition & 1 deletion core/src/browser/extensions/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export abstract class MCPExtension extends BaseExtension implements MCPInterface
* @returns A React component or null if no custom component is provided
*/
getToolComponent?(): ComponentType<MCPToolComponentProps> | null
}
}
2 changes: 1 addition & 1 deletion core/src/browser/models/manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ describe('ModelManager', () => {
expect(modelManager.models.get('model-2')).toEqual(model2)
})
})
})
})
2 changes: 1 addition & 1 deletion core/src/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// Ensure window exists in test environment
if (typeof window === 'undefined') {
global.window = {} as any
}

Check warning on line 6 in core/src/test/setup.ts

View workflow job for this annotation

GitHub Actions / coverage-check

5-6 lines are not covered with tests

// Mock window.core for browser tests
if (!window.core) {
Expand All @@ -16,4 +16,4 @@
})
}

// Add any other global mocks needed for core tests
// Add any other global mocks needed for core tests
2 changes: 1 addition & 1 deletion core/src/types/mcp/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './mcpEntity'
export * from './mcpInterface'
export * from './mcpInterface'
2 changes: 1 addition & 1 deletion core/src/types/mcp/mcpEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export interface MCPToolComponentProps {

/** Function to toggle a tool's enabled/disabled state */
onToolToggle: (toolName: string, enabled: boolean) => void
}
}
2 changes: 1 addition & 1 deletion core/src/types/mcp/mcpInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export interface MCPInterface {
* Check if MCP service is healthy
*/
isHealthy(): Promise<boolean>
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/conversational-web/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*/


export const CONVERSATION_API_ROUTES = {
CONVERSATIONS: '/conversations',
CONVERSATION_BY_ID: (id: string) => `/conversations/${id}`,
CONVERSATION_ITEMS: (id: string) => `/conversations/${id}/items`,
} as const

Check warning on line 10 in extensions-web/src/conversational-web/const.ts

View workflow job for this annotation

GitHub Actions / coverage-check

6-10 lines are not covered with tests

export const DEFAULT_ASSISTANT = {
id: 'jan',
name: 'Jan',
avatar: '👋',
created_at: 1747029866.542,
}
}

Check warning on line 17 in extensions-web/src/conversational-web/const.ts

View workflow job for this annotation

GitHub Actions / coverage-check

12-17 lines are not covered with tests
2 changes: 1 addition & 1 deletion extensions-web/src/jan-provider-web/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
* Handles API requests to Jan backend for models and chat completions
*/

import { getSharedAuthService, JanAuthService } from '../shared'
import { JanModel, janProviderStore } from './store'
import { ApiError } from '../shared/types/errors'

Check warning on line 8 in extensions-web/src/jan-provider-web/api.ts

View workflow job for this annotation

GitHub Actions / coverage-check

6-8 lines are not covered with tests

// JAN_API_BASE is defined in vite.config.ts

// Constants
const TEMPORARY_CHAT_ID = 'temporary-chat'

Check warning on line 13 in extensions-web/src/jan-provider-web/api.ts

View workflow job for this annotation

GitHub Actions / coverage-check

13 line is not covered with tests

/**
* Determines the appropriate API endpoint and request payload based on chat type
* @param request - The chat completion request
* @returns Object containing endpoint URL and processed request payload
*/
function getChatCompletionConfig(request: JanChatCompletionRequest, stream: boolean = false) {
const isTemporaryChat = request.conversation_id === TEMPORARY_CHAT_ID

Check warning on line 21 in extensions-web/src/jan-provider-web/api.ts

View workflow job for this annotation

GitHub Actions / coverage-check

20-21 lines are not covered with tests

// For temporary chats, use the stateless /chat/completions endpoint
// For regular conversations, use the stateful /conv/chat/completions endpoint
const endpoint = isTemporaryChat
? `${JAN_API_BASE}/chat/completions`
: `${JAN_API_BASE}/conv/chat/completions`

Check warning on line 27 in extensions-web/src/jan-provider-web/api.ts

View workflow job for this annotation

GitHub Actions / coverage-check

25-27 lines are not covered with tests

const payload = {
...request,
stream,
...(isTemporaryChat ? {

Check warning on line 32 in extensions-web/src/jan-provider-web/api.ts

View workflow job for this annotation

GitHub Actions / coverage-check

29-32 lines are not covered with tests
// For temporary chat: don't store anything, remove conversation metadata
conversation_id: undefined,
} : {
Expand Down Expand Up @@ -268,4 +268,4 @@
}
}

export const janApiClient = JanApiClient.getInstance()
export const janApiClient = JanApiClient.getInstance()
2 changes: 1 addition & 1 deletion extensions-web/src/jan-provider-web/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './provider'
export { default } from './provider'
2 changes: 1 addition & 1 deletion extensions-web/src/jan-provider-web/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ export const janProviderStore = {
useJanProviderStore.getState().clearError(),
reset: () =>
useJanProviderStore.getState().reset(),
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/mcp-web/components/WebSearchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export const WebSearchButton = ({
<span className={`text-sm font-medium ${isEnabled ? 'text-accent' : ''}`}>Search</span>
</button>
)
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/mcp-web/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { WebSearchButton } from './WebSearchButton'
export { WebSearchButton } from './WebSearchButton'
2 changes: 1 addition & 1 deletion extensions-web/src/mcp-web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ export default class MCPExtensionWeb extends MCPExtension {
getToolComponent(): ComponentType<MCPToolComponentProps> | null {
return WebSearchButton
}
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/mcp-web/oauth-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export class JanMCPOAuthProvider implements OAuthClientProvider {
async codeVerifier(): Promise<string> {
throw new Error('Code verifier not supported')
}
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/shared/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export class ApiError extends Error {
isServerError(): boolean {
return this.status >= 500 && this.status < 600
}
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export interface IndexedDBConfig {
keyPath: string
indexes?: { name: string; keyPath: string | string[]; unique?: boolean }[]
}[]
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {}

declare global {
declare const JAN_API_BASE: string
}
}
2 changes: 1 addition & 1 deletion extensions-web/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="vite/client" />
/// <reference types="vite/client" />
2 changes: 1 addition & 1 deletion extensions-web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite'

Check warning on line 1 in extensions-web/vite.config.ts

View workflow job for this annotation

GitHub Actions / coverage-check

1 line is not covered with tests

export default defineConfig({
build: {
Expand All @@ -16,4 +16,4 @@
define: {
JAN_API_BASE: JSON.stringify(process.env.JAN_API_BASE || 'https://api-dev.jan.ai/v1'),
}
})
})

Check warning on line 19 in extensions-web/vite.config.ts

View workflow job for this annotation

GitHub Actions / coverage-check

3-19 lines are not covered with tests
2 changes: 1 addition & 1 deletion web-app/src/__tests__/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ describe('i18n module', () => {
expect(i18nModule[exportName]).toBeDefined()
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/__tests__/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ describe('main.tsx', () => {
await import('../main')
}).rejects.toThrow()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ describe('Dialog Components', () => {
expect(screen.getByText('Dialog description')).toHaveAttribute('data-slot', 'dialog-description')
expect(screen.getByText('Footer button').closest('div')).toHaveAttribute('data-slot', 'dialog-footer')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/dropdown-menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -853,4 +853,4 @@ describe('DropdownMenu Components', () => {
expect(handleItemClick).toHaveBeenCalledTimes(1)
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/dropdrawer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,4 +530,4 @@ describe('DropDrawer Component', () => {
expect(trigger).toHaveAttribute('aria-haspopup', 'dialog')
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/hover-card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ describe('HoverCard Components', () => {
expect(screen.getByText('Hover content')).toBeDefined()
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ describe('Input', () => {
fireEvent.blur(input)
expect(handleBlur).toHaveBeenCalledTimes(1)
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/popover.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,4 @@ describe('Popover Components', () => {
})
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/progress.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ describe('Progress', () => {
// For values over 100, the transform should be positive
expect(indicator?.style.transform).toContain('translateX(--50%)')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/radio-group.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ describe('RadioGroup', () => {
expect(screen.getByLabelText('HTTP')).toBeChecked()
expect(screen.getByLabelText('SSE')).not.toBeChecked()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/sheet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,4 @@ describe('Sheet Components', () => {
expect(screen.getByText('Main Content')).toBeInTheDocument()
expect(screen.getByText('Close')).toBeInTheDocument()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/skeleton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ describe('Skeleton', () => {
expect(skeleton).toHaveClass('w-full')
expect(skeleton).toHaveClass('bg-red-500')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/slider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ describe('Slider', () => {
expect(thumb).toHaveClass('border-accent', 'bg-main-view', 'rounded-full')
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/sonner.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ describe('Toaster Component', () => {
expect(toaster).toHaveAttribute('data-rich-colors', 'true')
expect(toaster).toHaveAttribute('data-close-button', 'true')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/switch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ describe('Switch', () => {
const switchElement = document.querySelector('[data-slot="switch"]')
expect(switchElement).toHaveClass('data-[state=unchecked]:bg-main-view-fg/20')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/textarea.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ describe('Textarea', () => {
const textarea = screen.getByRole('textbox')
expect(textarea).toHaveAttribute('cols', '50')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/__tests__/tooltip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ describe('Tooltip Components', () => {
expect(screen.getByText('First')).toBeInTheDocument()
expect(screen.getByText('Second')).toBeInTheDocument()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/components/ui/radio-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ const RadioGroupItem = React.forwardRef<
})
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName

export { RadioGroup, RadioGroupItem }
export { RadioGroup, RadioGroupItem }
2 changes: 1 addition & 1 deletion web-app/src/constants/__tests__/windows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ describe('windows constants', () => {
expect(value.length).toBeGreaterThan(0)
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/constants/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*/

export const TEMPORARY_CHAT_ID = 'temporary-chat'
export const TEMPORARY_CHAT_QUERY_ID = 'temporary-chat'
export const TEMPORARY_CHAT_QUERY_ID = 'temporary-chat'
2 changes: 1 addition & 1 deletion web-app/src/containers/McpExtensionToolLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ export const McpExtensionToolLoader = ({
onToolToggle={handleToolToggle}
/>
)
}
}
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/AvatarEmoji.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ describe('AvatarEmoji Component', () => {
const img = screen.getByRole('img')
expect(img).toHaveAttribute('alt', 'Custom avatar')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/ChatInput.simple.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ describe('ChatInput Simple Tests', () => {
const sendButton = screen.getByTestId('send-message-button')
expect(sendButton).toHaveTextContent('Send')
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/ChatInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,4 @@ describe('ChatInput', () => {
expect(() => renderWithRouter()).not.toThrow()
})
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ describe('DropdownModelProvider - Display Name Integration', () => {
// Both models are still visible in the dropdown, so we can't test for absence
expect(screen.getAllByText('Short Name')).toHaveLength(2) // trigger + dropdown
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/EditModel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ describe('DialogEditModel - Basic Component Tests', () => {
expect(mockUpdateProvider).toBeDefined()
expect(mockSetProviders).toBeDefined()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/LeftPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,4 @@ describe('LeftPanel', () => {
const toggleButton = document.querySelector('svg.tabler-icon-layout-sidebar')
expect(toggleButton).not.toBeNull()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/__tests__/SetupScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ describe('SetupScreen', () => {
const setupContent = screen.getByText('setup:welcome').closest('div')
expect(setupContent).toBeInTheDocument()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/containers/dialogs/DeleteAssistantDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ export function DeleteAssistantDialog({
</DialogContent>
</Dialog>
)
}
}
2 changes: 1 addition & 1 deletion web-app/src/containers/dialogs/FactoryResetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ export function FactoryResetDialog({
</DialogContent>
</Dialog>
)
}
}
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useAnalytic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ describe('useAnalytic', () => {
expect(result.current.productAnalytic).toBe(false)
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useAppState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ describe('useAppState', () => {

expect(result.current.tokenSpeed).toBeUndefined()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useAppUpdater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,4 @@ describe('useAppUpdater', () => {
expect(mockEvents.emit).toHaveBeenCalledWith('onAppUpdateDownloadSuccess', {})
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useAppearance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ describe('useAppearance', () => {
expect(result.current.chatWidth).toBe('compact')
})
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useChat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ describe('useChat', () => {

expect(result.current).toBeDefined()
})
})
})
2 changes: 1 addition & 1 deletion web-app/src/hooks/__tests__/useClickOutside.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ describe('useClickOutside', () => {
addEventListenerSpy.mockRestore()
removeEventListenerSpy.mockRestore()
})
})
})
Loading
Loading