Skip to content

Commit

Permalink
feat: Add progress bar for file uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
absternator committed Jul 15, 2024
1 parent 025b77f commit 1f7100e
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,34 @@ describe("ProjectFile upload", () => {

expect(emitted()).toHaveProperty("onRunAnalysis");
});

it("should show uploadingPercentage with progress bar when samples are uploading", async () => {
const testPinia = createTestingPinia();
const store = useProjectStore(testPinia);
store.project.samples = MOCK_PROJECT_SAMPLES_BEFORE_RUN;
store.uploadingPercentage = 50;
render(ProjectFileUpload, {
global: {
plugins: [testPinia, PrimeVue]
}
});

const progressBar = screen.getByRole("progressbar");

expect(progressBar).toBeVisible();
expect(progressBar).toHaveAttribute("aria-valuenow", "50");
});
it("should not show uploadingPercentage with progress bar when samples finished uploading", async () => {
const testPinia = createTestingPinia();
const store = useProjectStore(testPinia);
store.project.samples = MOCK_PROJECT_SAMPLES_BEFORE_RUN;
store.uploadingPercentage = 100;
render(ProjectFileUpload, {
global: {
plugins: [testPinia, PrimeVue]
}
});

expect(screen.queryByRole("progressbar")).toBeNull();
});
});

0 comments on commit 1f7100e

Please sign in to comment.