Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bacpop 208 nw mc 1 call #88

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/client-v2/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ declare module 'vue' {
Button: typeof import('primevue/button')['default']
Column: typeof import('primevue/column')['default']
CreateProjectButton: typeof import('./src/components/HomeView/CreateProjectButton.vue')['default']
CreateProjectDialog: typeof import('./src/components/HomeView/CreateProjectDialog.vue')['default']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this disappeared?

CytoscapeCanvas: typeof import('./src/components/ProjectView/CytoscapeCanvas.vue')['default']
DataTable: typeof import('primevue/datatable')['default']
DeleteProjectButton: typeof import('./src/components/HomeView/DeleteProjectButton.vue')['default']
Expand All @@ -23,7 +22,6 @@ declare module 'vue' {
InputText: typeof import('primevue/inputtext')['default']
Menu: typeof import('primevue/menu')['default']
Menubar: typeof import('primevue/menubar')['default']
Message: typeof import('primevue/message')['default']
MicroReactColumn: typeof import('./src/components/ProjectView/MicroReactColumn.vue')['default']
MicroReactTokenDialog: typeof import('./src/components/ProjectView/MicroReactTokenDialog.vue')['default']
NetworkGraph: typeof import('./src/components/ProjectView/NetworkGraph.vue')['default']
Expand Down
12 changes: 4 additions & 8 deletions app/client-v2/e2e/projectPostRun.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ test("can run project and view results", async ({ page }) => {
uploadFiles(page, ["e2e/fastaFiles/good_1.fa"]);
await page.getByLabel("Run Analysis").click();

await expect(page.getByText("Running Analysis...33%")).toBeVisible();
await expect(page.getByText("Running Analysis...67%")).toBeVisible();
await expect(page.getByText("Running Analysis...50%")).toBeVisible();

await expect(page.getByLabel("Visit")).toBeVisible();
await expect(page.getByLabel("Download microreact zip")).toBeVisible();
Expand Down Expand Up @@ -64,8 +63,7 @@ test("can load up already run project even if loading", async ({ page }) => {
await page.getByRole("link", { name: "Beebop home" }).click();
await page.getByRole("link", { name: projectName }).click();

await expect(page.getByText("Running Analysis...33%")).toBeVisible();
await expect(page.getByText("Running Analysis...67%")).toBeVisible();
await expect(page.getByText("Running Analysis...50%")).toBeVisible();
await expect(page.getByLabel("Visit")).toBeVisible();
await expect(page.getByLabel("Download microreact zip")).toBeVisible();
await expect(page.getByLabel("Download network zip")).toBeVisible();
Expand All @@ -76,15 +74,13 @@ test("can run project multiple times", async ({ page }) => {
await uploadFiles(page, ["e2e/fastaFiles/good_1.fa"]);
await page.getByLabel("Run Analysis").click();

await expect(page.getByText("Running Analysis...33%")).toBeVisible();
await expect(page.getByText("Running Analysis...67%")).toBeVisible();
await expect(page.getByText("Running Analysis...50%")).toBeVisible();
await expect(page.getByLabel("Upload")).toBeVisible();

await uploadFiles(page, ["e2e/fastaFiles/good_2.fa"]);
await page.getByLabel("Run Analysis").click();

await expect(page.getByText("Running Analysis...33%")).toBeVisible();
await expect(page.getByText("Running Analysis...67%")).toBeVisible();
await expect(page.getByText("Running Analysis...50%")).toBeVisible();
await expect(page.getByText("GPSC7")).toBeVisible();
await expect(page.getByText("GPSC4")).toBeVisible();
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vitest.mock("@/composables/useMicroreact", () => ({
}));
const renderComponent = (
microreactStatus: string | null = "finished",
microreactClusterStatuses: Record<string, unknown> = { GPSC1: "finished" },
visualiseClusterstatuses: Record<string, unknown> = { GPSC1: "finished" },
cluster: string | null = "GPSC1",
hasRun = true
) =>
Expand All @@ -40,7 +40,7 @@ const renderComponent = (
initialState: {
project: {
project: {
status: { microreact: microreactStatus, microreactClusters: microreactClusterStatuses }
status: { microreact: microreactStatus, visualiseClusters: visualiseClusterstatuses }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ describe("RunProject", () => {
const { testPinia } = setupPinia({
samples: MOCK_PROJECT_SAMPLES,
status: {
network: "finished"
visualiseClusters: {
GPSC1: "finished"
}
}
});
renderComponent(testPinia);
Expand All @@ -59,7 +61,7 @@ describe("RunProject", () => {
expect(dataTable).not.toBeVisible();
});

it("should enable network tab on network finished", async () => {
it("should enable network tab when all visualise finished", async () => {
const { testPinia, store } = setupPinia({
samples: MOCK_PROJECT_SAMPLES
});
Expand All @@ -70,7 +72,9 @@ describe("RunProject", () => {
expect(tabPanel).toHaveAttribute("aria-disabled", "true");

store.project.status = {
network: "finished"
visualiseClusters: {
GPSC1: "finished"
}
} as any;

await waitFor(() => {
Expand All @@ -83,8 +87,8 @@ describe("RunProject", () => {
samples: MOCK_PROJECT_SAMPLES,
status: {
assign: "finished",
microreact: "finished",
network: "finished"
visualise: "finished",
visualiseClusters: Object.fromEntries(MOCK_PROJECT_SAMPLES.map((sample) => [sample.cluster!, "finished"]))
}
});
renderComponent(testPinia, false);
Expand Down Expand Up @@ -124,18 +128,17 @@ describe("RunProject", () => {
expect(screen.getAllByText(/not run/i).length).toBe(copyMockSamples.length);
});

it("should render failed network status if network analysis failed", async () => {
it("should render failed status chips if visualise analysis failed", async () => {
const { testPinia } = setupPinia({
samples: MOCK_PROJECT_SAMPLES,
status: {
assign: "finished",
microreact: "finished",
network: "failed"
visualise: "failed"
}
});
renderComponent(testPinia, false);

expect(screen.queryAllByText(/failed/i).length).toBe(MOCK_PROJECT_SAMPLES.length);
expect(screen.queryAllByText(/failed/i).length).toBe(MOCK_PROJECT_SAMPLES.length * 2); // microreact and network
});

it("should render disabled network download if finished and sample not run", async () => {
Expand All @@ -148,8 +151,7 @@ describe("RunProject", () => {
samples: copyMockSamples,
status: {
assign: "finished",
microreact: "finished",
network: "finished"
visualise: "finished"
}
});
renderComponent(testPinia, false);
Expand All @@ -164,22 +166,20 @@ describe("RunProject", () => {
samples: MOCK_PROJECT_SAMPLES,
status: {
assign: "finished",
microreact: "finished",
network: "started"
visualise: "started"
}
});
renderComponent(testPinia, false);

expect(screen.queryAllByText(/started/i).length).toBe(MOCK_PROJECT_SAMPLES.length);
expect(screen.queryAllByText(/started/i).length).toBe(MOCK_PROJECT_SAMPLES.length * 2); // microreact and network
});

it("should render disabled microreact setting button when microreact is not finished", async () => {
const { testPinia } = setupPinia({
samples: MOCK_PROJECT_SAMPLES,
status: {
assign: "finished",
microreact: "started",
network: "finished"
visualise: "started"
}
});
renderComponent(testPinia, false);
Expand All @@ -192,8 +192,7 @@ describe("RunProject", () => {
samples: MOCK_PROJECT_SAMPLES_BEFORE_RUN,
status: {
assign: "finished",
microreact: "finished",
network: "finished"
visualise: "finished"
}
});
renderComponent(testPinia, false);
Expand All @@ -216,9 +215,8 @@ describe("RunProject", () => {
samples: [{ ...MOCK_PROJECT_SAMPLES[0], cluster: undefined }],
status: {
assign: "finished",
microreact: "finished",
network: "finished",
microreactClusters: { x: "finished" }
visualise: "finished",
visualiseClusters: { x: "finished" }
}
});
renderComponent(testPinia, false);
Expand All @@ -230,7 +228,10 @@ describe("RunProject", () => {
const { testPinia } = setupPinia({
samples: MOCK_PROJECT_SAMPLES,
status: {
network: "finished"
visualise: "finished",
visualiseClusters: {
GPSC1: "finished"
}
}
});
renderComponent(testPinia);
Expand Down
Loading
Loading