diff --git a/website/src/components/LoadingListener.astro b/website/src/components/LoadingListener.astro
new file mode 100644
index 00000000..9fd11a75
--- /dev/null
+++ b/website/src/components/LoadingListener.astro
@@ -0,0 +1,62 @@
+---
+interface Props {
+ count: number;
+}
+
+const { count } = Astro.props;
+---
+
+
+
+
diff --git a/website/src/components/views/analyzeSingleVariant/GenericAnalyzeSingleVariantPage.astro b/website/src/components/views/analyzeSingleVariant/GenericAnalyzeSingleVariantPage.astro
index 2989103b..0f3aa6a3 100644
--- a/website/src/components/views/analyzeSingleVariant/GenericAnalyzeSingleVariantPage.astro
+++ b/website/src/components/views/analyzeSingleVariant/GenericAnalyzeSingleVariantPage.astro
@@ -14,6 +14,7 @@ import { type OrganismViewKey, type OrganismWithViewKey } from '../../../views/r
import { ServerSide } from '../../../views/serverSideRouting';
import { singleVariantViewKey } from '../../../views/viewKeys';
import ComponentsGrid from '../../ComponentsGrid.astro';
+import LoadingListener from '../../LoadingListener.astro';
import GsAggregate from '../../genspectrum/GsAggregate.astro';
import GsMutations from '../../genspectrum/GsMutations.astro';
import GsMutationsOverTime from '../../genspectrum/GsMutationsOverTime.astro';
@@ -58,6 +59,9 @@ const downloadLinks = noVariantSelected
downloadFileBasename: `${organism}_${sanitizeForFilename(displayName)}_accessions`,
},
];
+
+const count =
+ view.organismConstants.aggregatedVisualizations.singleVariant.length + 6 + (subdivisionField !== undefined ? 1 : 0);
---
@@ -71,75 +75,77 @@ const downloadLinks = noVariantSelected
-
- {
- noVariantSelected && (
-
-
-
- )
- }
-
-
-
-
+
+ {
+ noVariantSelected && (
+
+
+
+ )
+ }
+
+
+
+
+
+ {
+ subdivisionField !== undefined && (
+
+ )
+ }
+
+ {
+ view.organismConstants.aggregatedVisualizations.singleVariant.map(({ label, fields, views }) => (
+
+ ))
+ }
+
+
-
- {
- subdivisionField !== undefined && (
-
- )
- }
-
- {
- view.organismConstants.aggregatedVisualizations.singleVariant.map(({ label, fields, views }) => (
-
- ))
- }
-
-
-
-
+
+
diff --git a/website/tests/ViewPage.ts b/website/tests/ViewPage.ts
index be146eb7..2e29df69 100644
--- a/website/tests/ViewPage.ts
+++ b/website/tests/ViewPage.ts
@@ -23,4 +23,8 @@ export abstract class ViewPage {
public async selectDateRange(dateRangeOption: string) {
await this.page.locator('gs-date-range-filter').getByRole('combobox').first().selectOption(dateRangeOption);
}
+
+ public async waitForLoading() {
+ await this.page.waitForSelector('[aria-label="Loading"]', { state: 'detached' });
+ }
}
diff --git a/website/tests/mainPage.spec.ts b/website/tests/mainPage.spec.ts
index da980ec2..824da033 100644
--- a/website/tests/mainPage.spec.ts
+++ b/website/tests/mainPage.spec.ts
@@ -54,10 +54,12 @@ test.describe('Main page', () => {
});
allOrganisms.forEach((organism) => {
- test(`should navigate to all views for ${organism}`, async ({ page }) => {
- for (const { viewKey, linkName, title, expectedHeadline } of views) {
+ views.forEach((view) => {
+ const { viewKey, linkName, title, expectedHeadline } = view;
+ test(`should navigate to views ${title} for ${organism}`, async ({ page }) => {
if (!ServerSide.routing.isOrganismWithViewKey(organism, viewKey)) {
- continue;
+ test.skip();
+ return;
}
const organismName = organismConfig[organism].label;
@@ -68,11 +70,16 @@ test.describe('Main page', () => {
.locator('..')
.getByText(linkName, { exact: true })
.click();
+ // wait for the page to load
+ await page.waitForSelector('[aria-label="Loading"]', { state: 'detached' });
+ await page.waitForSelector('text="Loading data"', { state: 'hidden' });
+ await page.waitForTimeout(10);
+
await expect(page.locator('text=Error -')).not.toBeVisible();
await expect(page.locator('text=Something went wrong')).not.toBeVisible();
await expect(page).toHaveTitle(`${title} | ${organismName} | GenSpectrum`);
await expect(page.getByRole('heading', { name: expectedHeadline }).first()).toBeVisible();
- }
+ });
});
});
});