char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: ESLint config updates (#27700)f1357e499

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