Skip to content

Commit

Permalink
Fix jest tests for non-kebab stub searches. This should be redone so
Browse files Browse the repository at this point in the history
we're not asserting stub existence though, probably.
  • Loading branch information
dannon committed Jul 14, 2023
1 parent 21f5a43 commit 37c7cb4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ describe("DatasetStorage.vue", () => {
it("test loading...", async () => {
mount();
await wrapper.vm.$nextTick();
expect(wrapper.findAll("loading-span-stub").length).toBe(1);
expect(wrapper.findAll("describe-object-store-stub").length).toBe(0);
expect(wrapper.findAll("loadingspan-stub").length).toBe(1);
expect(wrapper.findAll("describeobjectstore-stub").length).toBe(0);
});

it("test error rendering...", async () => {
Expand All @@ -52,13 +52,13 @@ describe("DatasetStorage.vue", () => {
await flushPromises();
expect(wrapper.findAll(".error").length).toBe(1);
expect(wrapper.findAll(".error").at(0).text()).toBe(TEST_ERROR_MESSAGE);
expect(wrapper.findAll("loading-span-stub").length).toBe(0);
expect(wrapper.findAll("loadingspan-stub").length).toBe(0);
});

it("test dataset storage with object store without id", async () => {
await mountWithResponse(TEST_STORAGE_API_RESPONSE_WITHOUT_ID);
expect(wrapper.findAll("loading-span-stub").length).toBe(0);
expect(wrapper.findAll("describe-object-store-stub").length).toBe(1);
expect(wrapper.findAll("loadingspan-stub").length).toBe(0);
expect(wrapper.findAll("describeobjectstore-stub").length).toBe(1);
expect(wrapper.vm.storageInfo.private).toEqual(false);
});

Expand Down
7 changes: 4 additions & 3 deletions client/src/components/HistoryExport/ToLink.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe("ToLink.vue", () => {
localVue,
});
await wrapper.vm.$nextTick();
expect(wrapper.find("loading-span-stub").exists()).toBeTruthy();
console.debug(wrapper.html());
expect(wrapper.find("loadingspan-stub").exists()).toBeTruthy();
await flushPromises();
}

Expand All @@ -38,7 +39,7 @@ describe("ToLink.vue", () => {
it("should display a link if no exports ever generated", async () => {
await mountWithInitialExports([]);
expect(wrapper.find(".export-link")).toBeTruthy();
expect(wrapper.find("loading-span-stub").exists()).toBeFalsy(); // loading span gone
expect(wrapper.find("loadingspan-stub").exists()).toBeFalsy(); // loading span gone
});

it("should start polling if latest export is preparing", async () => {
Expand All @@ -56,7 +57,7 @@ describe("ToLink.vue", () => {
]);
expect(then).toBeTruthy();
expect(wrapper.vm.waitingOnJob).toBeTruthy();
expect(wrapper.find("loading-span-stub").exists()).toBeTruthy();
expect(wrapper.find("loadingspan-stub").exists()).toBeTruthy();
});

afterEach(() => {
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Toolshed/InstalledList/Details.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe("Details", () => {
},
localVue,
});
expect(wrapper.findAll("loading-span-stub").length).toBe(1);
expect(wrapper.find("loading-span-stub").attributes("message")).toBe("Loading installed repository details");
expect(wrapper.findAll("loadingspan-stub").length).toBe(1);
expect(wrapper.find("loadingspan-stub").attributes("message")).toBe("Loading installed repository details");
expect(wrapper.findAll("repositorydetails-stub").length).toBe(0);
await localVue.nextTick();
expect(wrapper.findAll("loading-span-stub").length).toBe(0);
expect(wrapper.findAll("loadingspan-stub").length).toBe(0);
expect(wrapper.findAll(".alert").length).toBe(0);
expect(wrapper.findAll("repositorydetails-stub").length).toBe(1);
});
Expand Down

0 comments on commit 37c7cb4

Please sign in to comment.