mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 22:37:14 +00:00
chore: Adding unit tests for UI
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
5e7c2250be
commit
db96b10d4d
2 changed files with 10 additions and 1 deletions
|
|
@ -52,8 +52,10 @@ export default function ContentsListPage() {
|
||||||
const [file, setFile] = useState<VectorStoreFile | null>(null);
|
const [file, setFile] = useState<VectorStoreFile | null>(null);
|
||||||
const [contents, setContents] = useState<VectorStoreContentItem[]>([]);
|
const [contents, setContents] = useState<VectorStoreContentItem[]>([]);
|
||||||
const [isLoadingStore, setIsLoadingStore] = useState(true);
|
const [isLoadingStore, setIsLoadingStore] = useState(true);
|
||||||
|
const [isLoadingFile, setIsLoadingFile] = useState(true);
|
||||||
const [isLoadingContents, setIsLoadingContents] = useState(true);
|
const [isLoadingContents, setIsLoadingContents] = useState(true);
|
||||||
const [errorStore, setErrorStore] = useState<Error | null>(null);
|
const [errorStore, setErrorStore] = useState<Error | null>(null);
|
||||||
|
const [errorFile, setErrorFile] = useState<Error | null>(null);
|
||||||
const [errorContents, setErrorContents] = useState<Error | null>(null);
|
const [errorContents, setErrorContents] = useState<Error | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -175,7 +177,13 @@ export default function ContentsListPage() {
|
||||||
<CardTitle>Content Chunks ({contents.length})</CardTitle>
|
<CardTitle>Content Chunks ({contents.length})</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
{isLoadingContents ? (
|
{isLoadingFile ? (
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
) : errorFile ? (
|
||||||
|
<div className="text-destructive text-sm">
|
||||||
|
Error loading file: {errorFile.message}
|
||||||
|
</div>
|
||||||
|
) : isLoadingContents ? (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Skeleton className="h-4 w-full" />
|
<Skeleton className="h-4 w-full" />
|
||||||
<Skeleton className="h-4 w-3/4" />
|
<Skeleton className="h-4 w-3/4" />
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,7 @@ const COMPONENTS = {
|
||||||
code: ({
|
code: ({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
|
...rest
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue