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 PwaRefreshAlert from '$lib/components/pwa/PwaRefreshAlert.svelte' ; 4import { expect } from 'storybook/test' ; 5 6const { Story} = defineMeta ({ 7component :PwaRefreshAlert , 8parameters :{ 9layout :'centered' 10}, 11title :'Components/PwaRefreshAlert' 12}); 13</ script > 14 15< Story 16args ={{ needRefresh :true , updateServiceWorker :() => console . log ( 'reload' ) }} 17name ="Default " 18play ={ async ({ canvas}) => { 19const title = canvas . getByText ( 'Update available' ); 20 21await expect ( title ). toBeInTheDocument (); 22 23const description = canvas . getByText ( / A new version is available / ); 24 25await expect ( description ). toBeInTheDocument (); 26 27const button = canvas . getByRole ( 'button' , { name :'Reload' }); 28 29await expect ( button ). toBeInTheDocument (); 30}} 31/> 32 33< Story 34args ={{ needRefresh :false , updateServiceWorker :() => console . log ( 'reload' ) }} 35name ="Hidden " 36play ={ async ({ canvas}) => { 37const title = canvas . queryByText ( 'Update available' ); 38 39await expect ( title ). not . toBeInTheDocument (); 40}} 41/> 42 43< Story 44args ={{ 45needRefresh :true , 46updateServiceWorker :() => console . log ( 'reload' ) 47}} 48name ="ClickReload " 49play ={ async ({ canvas, userEvent}) => { 50const button = canvas . getByRole ( 'button' , { name :'Reload' }); 51 52await expect ( button ). toBeInTheDocument (); 53 54await userEvent . click ( button ); 55 56const title = canvas . queryByText ( 'Update available' ); 57 58await expect ( title ). not . toBeInTheDocument (); 59 60const reloadBtn = canvas . queryByRole ( 'button' , { name :'Reload' }); 61 62await expect ( reloadBtn ). not . toBeInTheDocument (); 63}} 64/>