Skip to content

Commit

Permalink
Add test to protect against null-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
surchs committed Oct 17, 2023
1 parent aeef78f commit d87e193
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cypress/component/category-toolgroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ describe("Tool Group component", () => {
cy.get("[data-cy='toolgroup-select']").type("MOCA{enter}");
cy.get("@commitSpy").should("have.been.calledWith", "createToolGroup", { identifier: 'cogatlas:MOCA', label: 'MOCA' });

});

it("clearing the dropdown selection does not crash the app", () => {
cy.mount(categoryToolGroup, {
mocks: {
$store: store
}
});

cy.get("[data-cy='toolgroup-select']").type("MOCA{enter}");
cy.get("[data-cy='toolgroup-select']").get('button').click();

});

Expand Down

0 comments on commit d87e193

Please sign in to comment.