Skip to content

chore: fix backend unit tests #1

chore: fix backend unit tests

chore: fix backend unit tests #1

Triggered via push August 17, 2025 19:18
Status Failure
Total duration 35s
Artifacts
frontend-coverage
27s
frontend-coverage
Fit to window
Zoom out
Zoom in

Annotations

10 errors
src/components/FolderSelector.test.tsx > FolderSelector > navigates to recent project and selects on double click: tauri-ui/src/context/ChatContext.tsx#L700
Error: useChat must be used within a <ChatProvider> ❯ useChat src/context/ChatContext.tsx:700:19 ❯ x.constructor src/components/FolderSelector.tsx:25:26 ❯ x.render node_modules/preact/src/diff/index.js:680:14 ❯ diff node_modules/preact/src/diff/index.js:241:14 ❯ diffChildren node_modules/preact/src/diff/children.js:97:16 ❯ diff node_modules/preact/src/diff/index.js:267:13 ❯ E node_modules/preact/src/render.js:42:2 ❯ cb node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 ❯ u node_modules/preact/test-utils/src/index.js:91:12 ❯ Module.render node_modules/@testing-library/preact/dist/esm/pure.mjs:44:3
src/components/FolderSelector.test.tsx > FolderSelector > navigates to folder and selects on double click (folder list): tauri-ui/src/context/ChatContext.tsx#L700
Error: useChat must be used within a <ChatProvider> ❯ useChat src/context/ChatContext.tsx:700:19 ❯ x.constructor src/components/FolderSelector.tsx:25:26 ❯ x.render node_modules/preact/src/diff/index.js:680:14 ❯ diff node_modules/preact/src/diff/index.js:241:14 ❯ diffChildren node_modules/preact/src/diff/children.js:97:16 ❯ diff node_modules/preact/src/diff/index.js:267:13 ❯ E node_modules/preact/src/render.js:42:2 ❯ cb node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 ❯ u node_modules/preact/test-utils/src/index.js:91:12 ❯ Module.render node_modules/@testing-library/preact/dist/esm/pure.mjs:44:3
src/components/FolderSelector.test.tsx > FolderSelector > navigates by clicking breadcrumb: tauri-ui/src/context/ChatContext.tsx#L700
Error: useChat must be used within a <ChatProvider> ❯ useChat src/context/ChatContext.tsx:700:19 ❯ x.constructor src/components/FolderSelector.tsx:25:26 ❯ x.render node_modules/preact/src/diff/index.js:680:14 ❯ diff node_modules/preact/src/diff/index.js:241:14 ❯ diffChildren node_modules/preact/src/diff/children.js:97:16 ❯ diff node_modules/preact/src/diff/index.js:267:13 ❯ E node_modules/preact/src/render.js:42:2 ❯ cb node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 ❯ u node_modules/preact/test-utils/src/index.js:91:12 ❯ Module.render node_modules/@testing-library/preact/dist/esm/pure.mjs:44:3
src/components/FolderSelector.test.tsx > FolderSelector > calls onClose when clicking backdrop or X: tauri-ui/src/context/ChatContext.tsx#L700
Error: useChat must be used within a <ChatProvider> ❯ useChat src/context/ChatContext.tsx:700:19 ❯ x.constructor src/components/FolderSelector.tsx:25:26 ❯ x.render node_modules/preact/src/diff/index.js:680:14 ❯ diff node_modules/preact/src/diff/index.js:241:14 ❯ diffChildren node_modules/preact/src/diff/children.js:97:16 ❯ diff node_modules/preact/src/diff/index.js:267:13 ❯ E node_modules/preact/src/render.js:42:2 ❯ cb node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 ❯ u node_modules/preact/test-utils/src/index.js:91:12 ❯ Module.render node_modules/@testing-library/preact/dist/esm/pure.mjs:44:3
src/components/FolderSelector.test.tsx > FolderSelector > renders folders and recent projects with unique test ids: tauri-ui/src/context/ChatContext.tsx#L700
Error: useChat must be used within a <ChatProvider> ❯ useChat src/context/ChatContext.tsx:700:19 ❯ x.constructor src/components/FolderSelector.tsx:25:26 ❯ x.render node_modules/preact/src/diff/index.js:680:14 ❯ diff node_modules/preact/src/diff/index.js:241:14 ❯ diffChildren node_modules/preact/src/diff/children.js:97:16 ❯ diff node_modules/preact/src/diff/index.js:267:13 ❯ E node_modules/preact/src/render.js:42:2 ❯ cb node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 ❯ u node_modules/preact/test-utils/src/index.js:91:12 ❯ Module.render node_modules/@testing-library/preact/dist/esm/pure.mjs:44:3
src/components/ChatToolbar.test.tsx > ChatToolbar > allows typing and sending a message: tauri-ui/src/components/ChatToolbar.test.tsx#L88
AssertionError: expected "spy" to be called with arguments: [ 'Hello world' ] Number of calls: 0 ❯ src/components/ChatToolbar.test.tsx:88:20
src/components/App.test.tsx > App > shows and closes FolderSelector modal: tauri-ui/src/components/App.test.tsx#L150
TestingLibraryElementError: Unable to find an element by: [data-testid="project-path-selector"] Ignored nodes: comments, script, style <body> <div> <div class="flex h-screen w-screen bg-neutral-50 text-gray-800" > <main class="flex-1 flex flex-col h-full" > <div class="flex items-center flex-wrap justify-between gap-1 px-4 py-2 border-b bg-white shadow-sm text-sm" > <div class="flex items-center" > <span class="text-lg font-semibold text-gray-700" > Suhana </span> </div> <div class="flex gap-2 flex-wrap" > <div class="flex items-center gap-1 border border-gray-200 rounded overflow-hidden bg-white" > <button class="p-2 hover:bg-gray-100 text-gray-600" title="Login" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="m10 17 5-5-5-5" /> <path d="M15 12H3" /> <path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /> </svg> </button> <div class="w-px bg-gray-200 h-5" /> <button class="p-2 hover:bg-gray-100 text-gray-600" title="Register" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <circle cx="9" cy="7" r="4" /> <line x1="19" x2="19" y1="8" y2="14" /> <line x1="22" x2="16" y1="11" y2="11" /> </svg> </button> </div> </div> </div> <div class="flex-1 flex flex-col items-center justify-center p-8 text-center" > <img alt="Suhana logo" class="h-24 mb-6" src="./suhana.png" /> <h1 class="text-3xl font-bold text-gray-800 mb-3" > Welcome to Suhana </h1> <p class="text-base text-gray-600 max-w-xl mb-6" > Your intelligent assistant for development and conversation. <br /> Please log in or register to get started. </p> <div class="flex gap-3" > <button class="text-sm px-5 py-2.5 rounded bg-black text-white hover:bg-gray-900 shadow-sm" > Login </button> <button class="text-sm px-5 py-2.5 rounded border border-gray-300 text-gray-700 hover:bg-gray-100" > Register </button> </div> </div> </main> <aside class="transition-all duration-300 bg
src/components/App.test.tsx > App > toggles sidebar when menu button clicked: tauri-ui/src/components/App.test.tsx#L141
TestingLibraryElementError: Unable to find an element with the title: Toggle Sidebar. Ignored nodes: comments, script, style <body> <div> <div class="flex h-screen w-screen bg-neutral-50 text-gray-800" > <main class="flex-1 flex flex-col h-full" > <div class="flex items-center flex-wrap justify-between gap-1 px-4 py-2 border-b bg-white shadow-sm text-sm" > <div class="flex items-center" > <span class="text-lg font-semibold text-gray-700" > Suhana </span> </div> <div class="flex gap-2 flex-wrap" > <div class="flex items-center gap-1 border border-gray-200 rounded overflow-hidden bg-white" > <button class="p-2 hover:bg-gray-100 text-gray-600" title="Login" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="m10 17 5-5-5-5" /> <path d="M15 12H3" /> <path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /> </svg> </button> <div class="w-px bg-gray-200 h-5" /> <button class="p-2 hover:bg-gray-100 text-gray-600" title="Register" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <circle cx="9" cy="7" r="4" /> <line x1="19" x2="19" y1="8" y2="14" /> <line x1="22" x2="16" y1="11" y2="11" /> </svg> </button> </div> </div> </div> <div class="flex-1 flex flex-col items-center justify-center p-8 text-center" > <img alt="Suhana logo" class="h-24 mb-6" src="./suhana.png" /> <h1 class="text-3xl font-bold text-gray-800 mb-3" > Welcome to Suhana </h1> <p class="text-base text-gray-600 max-w-xl mb-6" > Your intelligent assistant for development and conversation. <br /> Please log in or register to get started. </p> <div class="flex gap-3" > <button class="text-sm px-5 py-2.5 rounded bg-black text-white hover:bg-gray-900 shadow-sm" > Login </button> <button class="text-sm px-5 py-2.5 rounded border border-gray-300 text-gray-700 hover:bg-gray-100" > Register </button> </div> </div> </main> <aside class="transition-all duration-300 bg-white bor
src/components/App.test.tsx > App > calls setMessages and sendStreamingMessage when sending a message: tauri-ui/src/components/App.test.tsx#L127
TestingLibraryElementError: Unable to find an element by: [data-testid="toolbar"] Ignored nodes: comments, script, style <body> <div> <div class="flex h-screen w-screen bg-neutral-50 text-gray-800" > <main class="flex-1 flex flex-col h-full" > <div class="flex items-center flex-wrap justify-between gap-1 px-4 py-2 border-b bg-white shadow-sm text-sm" > <div class="flex items-center" > <span class="text-lg font-semibold text-gray-700" > Suhana </span> </div> <div class="flex gap-2 flex-wrap" > <div class="flex items-center gap-1 border border-gray-200 rounded overflow-hidden bg-white" > <button class="p-2 hover:bg-gray-100 text-gray-600" title="Login" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="m10 17 5-5-5-5" /> <path d="M15 12H3" /> <path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /> </svg> </button> <div class="w-px bg-gray-200 h-5" /> <button class="p-2 hover:bg-gray-100 text-gray-600" title="Register" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <circle cx="9" cy="7" r="4" /> <line x1="19" x2="19" y1="8" y2="14" /> <line x1="22" x2="16" y1="11" y2="11" /> </svg> </button> </div> </div> </div> <div class="flex-1 flex flex-col items-center justify-center p-8 text-center" > <img alt="Suhana logo" class="h-24 mb-6" src="./suhana.png" /> <h1 class="text-3xl font-bold text-gray-800 mb-3" > Welcome to Suhana </h1> <p class="text-base text-gray-600 max-w-xl mb-6" > Your intelligent assistant for development and conversation. <br /> Please log in or register to get started. </p> <div class="flex gap-3" > <button class="text-sm px-5 py-2.5 rounded bg-black text-white hover:bg-gray-900 shadow-sm" > Login </button> <button class="text-sm px-5 py-2.5 rounded border border-gray-300 text-gray-700 hover:bg-gray-100" > Register </button> </div> </div> </main> <aside class="transition-all duration-300 bg-white border-
src/components/App.test.tsx > App > renders sidebar, toolbar, and messages when ready: tauri-ui/src/components/App.test.tsx#L119
TestingLibraryElementError: Unable to find an element by: [data-testid="sidebar"] Ignored nodes: comments, script, style <body> <div> <div class="flex h-screen w-screen bg-neutral-50 text-gray-800" > <main class="flex-1 flex flex-col h-full" > <div class="flex items-center flex-wrap justify-between gap-1 px-4 py-2 border-b bg-white shadow-sm text-sm" > <div class="flex items-center" > <span class="text-lg font-semibold text-gray-700" > Suhana </span> </div> <div class="flex gap-2 flex-wrap" > <div class="flex items-center gap-1 border border-gray-200 rounded overflow-hidden bg-white" > <button class="p-2 hover:bg-gray-100 text-gray-600" title="Login" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="m10 17 5-5-5-5" /> <path d="M15 12H3" /> <path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /> </svg> </button> <div class="w-px bg-gray-200 h-5" /> <button class="p-2 hover:bg-gray-100 text-gray-600" title="Register" > <svg class="w-4 h-4" fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" > <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <circle cx="9" cy="7" r="4" /> <line x1="19" x2="19" y1="8" y2="14" /> <line x1="22" x2="16" y1="11" y2="11" /> </svg> </button> </div> </div> </div> <div class="flex-1 flex flex-col items-center justify-center p-8 text-center" > <img alt="Suhana logo" class="h-24 mb-6" src="./suhana.png" /> <h1 class="text-3xl font-bold text-gray-800 mb-3" > Welcome to Suhana </h1> <p class="text-base text-gray-600 max-w-xl mb-6" > Your intelligent assistant for development and conversation. <br /> Please log in or register to get started. </p> <div class="flex gap-3" > <button class="text-sm px-5 py-2.5 rounded bg-black text-white hover:bg-gray-900 shadow-sm" > Login </button> <button class="text-sm px-5 py-2.5 rounded border border-gray-300 text-gray-700 hover:bg-gray-100" > Register </button> </div> </div> </main> <aside class="transition-all duration-300 bg-white border-