- {#if loading}
-
- {/if}
{#if !loading}
{#if tasks.length > 0}
diff --git a/packages/frontend/src/pages/RecipeModels.svelte b/packages/frontend/src/pages/RecipeModels.svelte
index a4def8571..effd0e591 100644
--- a/packages/frontend/src/pages/RecipeModels.svelte
+++ b/packages/frontend/src/pages/RecipeModels.svelte
@@ -2,11 +2,11 @@
import type { ModelInfo } from '@shared/src/models/IModelInfo';
import Table from '../lib/table/Table.svelte';
import { Column, Row } from '../lib/table/table';
- import ModelColumnName from './ModelColumnName.svelte';
- import ModelColumnRegistry from './ModelColumnRegistry.svelte';
- import ModelColumnPopularity from './ModelColumnPopularity.svelte';
- import ModelColumnLicense from './ModelColumnLicense.svelte';
- import ModelColumnHw from './ModelColumnHW.svelte';
+ import ModelColumnName from '../lib/table/model/ModelColumnName.svelte';
+ import ModelColumnRegistry from '../lib/table/model/ModelColumnRegistry.svelte';
+ import ModelColumnPopularity from '../lib/table/model/ModelColumnPopularity.svelte';
+ import ModelColumnLicense from '../lib/table/model/ModelColumnLicense.svelte';
+ import ModelColumnHw from '../lib/table/model/ModelColumnHW.svelte';
import { onMount } from 'svelte';
import { studioClient } from '../utils/client';
@@ -16,7 +16,7 @@
onMount(async () => {
if (modelsIds && modelsIds.length > 0) {
models = await studioClient.getModelsByIds(modelsIds);
- }
+ }
})
const columns: Column[] = [
From 9ec894d8a61bf08f15839b5e6965a070c7688e48 Mon Sep 17 00:00:00 2001
From: axel7083 <42176370+axel7083@users.noreply.github.com>
Date: Wed, 17 Jan 2024 17:18:55 +0100
Subject: [PATCH 2/4] test: ensuring progress is displayed when loading is true
---
packages/frontend/src/lib/NavPage.spec.ts | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 packages/frontend/src/lib/NavPage.spec.ts
diff --git a/packages/frontend/src/lib/NavPage.spec.ts b/packages/frontend/src/lib/NavPage.spec.ts
new file mode 100644
index 000000000..dce409e37
--- /dev/null
+++ b/packages/frontend/src/lib/NavPage.spec.ts
@@ -0,0 +1,22 @@
+import '@testing-library/jest-dom/vitest';
+import { test, expect } from 'vitest';
+import { fireEvent, render, screen, within } from '@testing-library/svelte';
+import NavPage from '/@/lib/NavPage.svelte';
+
+test('NavPage should have linear progress', async () => {
+ // render the component
+ render(NavPage, {loading: true, title: 'dummy'});
+
+ const content = await screen.findByLabelText('content');
+ expect(content).toBeDefined();
+ expect(content.firstChild?.nodeName).toBe('PROGRESS');
+});
+
+test('NavPage should not have linear progress', async () => {
+ // render the component
+ render(NavPage, {title: 'dummy'},);
+
+ const content = await screen.findByLabelText('content');
+ expect(content).toBeDefined();
+ expect(content.firstChild).toBeNull(); // no slot content provided
+});
From 3b5db7b04f4d32825f90841fd42a53e3497cf447 Mon Sep 17 00:00:00 2001
From: axel7083 <42176370+axel7083@users.noreply.github.com>
Date: Wed, 17 Jan 2024 17:21:04 +0100
Subject: [PATCH 3/4] fix: linter
---
packages/frontend/src/lib/NavPage.spec.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/frontend/src/lib/NavPage.spec.ts b/packages/frontend/src/lib/NavPage.spec.ts
index dce409e37..4ac765b9e 100644
--- a/packages/frontend/src/lib/NavPage.spec.ts
+++ b/packages/frontend/src/lib/NavPage.spec.ts
@@ -1,6 +1,6 @@
import '@testing-library/jest-dom/vitest';
import { test, expect } from 'vitest';
-import { fireEvent, render, screen, within } from '@testing-library/svelte';
+import { render, screen } from '@testing-library/svelte';
import NavPage from '/@/lib/NavPage.svelte';
test('NavPage should have linear progress', async () => {
@@ -14,7 +14,7 @@ test('NavPage should have linear progress', async () => {
test('NavPage should not have linear progress', async () => {
// render the component
- render(NavPage, {title: 'dummy'},);
+ render(NavPage, {title: 'dummy'});
const content = await screen.findByLabelText('content');
expect(content).toBeDefined();
From a2b2b84a27d2a24d757ddb49becde3ab30376567 Mon Sep 17 00:00:00 2001
From: axel7083 <42176370+axel7083@users.noreply.github.com>
Date: Wed, 17 Jan 2024 17:26:34 +0100
Subject: [PATCH 4/4] fix: prettier
---
packages/frontend/src/lib/NavPage.spec.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/frontend/src/lib/NavPage.spec.ts b/packages/frontend/src/lib/NavPage.spec.ts
index 4ac765b9e..fde5d0da0 100644
--- a/packages/frontend/src/lib/NavPage.spec.ts
+++ b/packages/frontend/src/lib/NavPage.spec.ts
@@ -5,7 +5,7 @@ import NavPage from '/@/lib/NavPage.svelte';
test('NavPage should have linear progress', async () => {
// render the component
- render(NavPage, {loading: true, title: 'dummy'});
+ render(NavPage, { loading: true, title: 'dummy' });
const content = await screen.findByLabelText('content');
expect(content).toBeDefined();
@@ -14,7 +14,7 @@ test('NavPage should have linear progress', async () => {
test('NavPage should not have linear progress', async () => {
// render the component
- render(NavPage, {title: 'dummy'});
+ render(NavPage, { title: 'dummy' });
const content = await screen.findByLabelText('content');
expect(content).toBeDefined();