char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
f1357e499
char/aliceai-t5-moe
1< script lang ="ts "module > 2import { defineMeta } from '@storybook/addon-svelte-csf' ; 3import SidebarNavigation from '$lib/components/app/navigation/SidebarNavigation/SidebarNavigation.svelte' ; 4import { waitFor } from 'storybook/test' ; 5import { screen } from 'storybook/test' ; 6 7const { Story} = defineMeta ({ 8component :SidebarNavigation , 9parameters :{ 10layout :'centered' 11}, 12title :'Components/SidebarNavigation' 13}); 14</ script > 15 16< script lang ="ts "> 17// Mock conversations for the sidebar 18const mockConversations :DatabaseConversation [] = [ 19{ 20currNode :'msg-1' , 21id :'conv-1' , 22lastModified :Date . now () - 1000 * 60 * 5 , // 5 minutes ago 23name :'Getting Started with AI' 24}, 25{ 26currNode :'msg-2' , 27id :'conv-2' , 28lastModified :Date . now () - 1000 * 60 * 60 * 2 , // 2 hours ago 29name :'Python Programming Help' 30}, 31{ 32currNode :'msg-3' , 33id :'conv-3' , 34lastModified :Date . now () - 1000 * 60 * 60 * 24 , // 1 day ago 35name :'Creative Writing Ideas' 36}, 37{ 38currNode :'msg-4' , 39id :'conv-4' , 40lastModified :Date . now () - 1000 * 60 * 60 * 24 * 3 , // 3 days ago 41name :'This is a very long conversation title that should be truncated properly when displayed' 42}, 43{ 44currNode :'msg-5' , 45id :'conv-5' , 46lastModified :Date . now () - 1000 * 60 * 60 * 24 * 7 , // 1 week ago 47name :'Math Problem Solving' 48} 49]; 50</ script > 51 52< Story 53asChild 54name ="Default " 55play ={ async () => { 56const { conversationsStore} = await import ( '$lib/stores/conversations/index.svelte' ); 57 58waitFor (() => 59setTimeout (() => { 60conversationsStore . conversations = mockConversations ; 61}, 0 ) 62); 63}} 64> 65< div class ="flex-column h-screen w-72 bg-background "> 66< SidebarNavigation /> 67</ div > 68</ Story > 69 70< Story 71asChild 72name ="SearchActive " 73play ={ async ({ userEvent}) => { 74const { conversationsStore} = await import ( '$lib/stores/conversations/index.svelte' ); 75 76waitFor (() => 77setTimeout (() => { 78conversationsStore . conversations = mockConversations ; 79}, 0 ) 80); 81 82// Expand sidebar first, then click Search in the expanded button list 83const logoTrigger = screen . getByRole ( 'button' , { name :/ expand navigation / i }); 84 85await userEvent . click ( logoTrigger ); 86const searchTrigger = screen . getByText ( 'Search' ); 87 88userEvent . click ( searchTrigger ); 89}} 90> 91< div class ="flex-column h-screen w-72 bg-background "> 92< SidebarNavigation /> 93</ div > 94</ Story > 95 96< Story 97asChild 98name ="Empty " 99play ={ async () => { 100// Mock empty conversations store 101const { conversationsStore} = await import ( '$lib/stores/conversations/index.svelte' ); 102 103conversationsStore . conversations = []; 104}} 105> 106< div class ="flex-column h-screen w-72 bg-background "> 107< SidebarNavigation /> 108</ div > 109</ Story >