Skip to content

Commit

Permalink
add is disabled check for export tab in jest as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Dec 10, 2024
1 parent 8838d2c commit 2c5dcb9
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const selectors = {
bAlertStub: "balert-stub",
spanElement: "span",
invocationReportTab: '[titleitemclass="invocation-report-tab"]',
invocationExportTab: '[titleitemclass="invocation-export-tab"]',
fullPageHeading: "anonymous-stub[h1='true']",
};

Expand Down Expand Up @@ -177,16 +178,20 @@ describe("WorkflowInvocationState check invocation and job terminal states", ()
});
});

describe("WorkflowInvocationState check 'Report' tab disabled state and header", () => {
it("determines that 'Report' tab is disabled for non-terminal invocation", async () => {
describe("WorkflowInvocationState check 'Report' and 'Export' tab disabled state and header", () => {
it("for non-terminal invocation", async () => {
const wrapper = await mountWorkflowInvocationState("non-terminal-id");
const reportTab = wrapper.find(selectors.invocationReportTab);
expect(reportTab.attributes("disabled")).toBe("true");
const exportTab = wrapper.find(selectors.invocationExportTab);
expect(exportTab.attributes("disabled")).toBe("true");
});
it("determines that 'Report' tab is not disabled for terminal invocation", async () => {
it("for terminal invocation", async () => {
const wrapper = await mountWorkflowInvocationState(invocationData.id);
const reportTab = wrapper.find(selectors.invocationReportTab);
expect(reportTab.attributes("disabled")).toBeUndefined();
const exportTab = wrapper.find(selectors.invocationExportTab);
expect(exportTab.attributes("disabled")).toBeUndefined();
});
});

Expand Down

0 comments on commit 2c5dcb9

Please sign in to comment.