From d87e193cbddc52085d29dfb67ba1fae151441a5e Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Tue, 17 Oct 2023 17:14:54 -0400 Subject: [PATCH] Add test to protect against null-crash --- cypress/component/category-toolgroup.cy.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cypress/component/category-toolgroup.cy.js b/cypress/component/category-toolgroup.cy.js index a07a9ba0..4c78cf7e 100644 --- a/cypress/component/category-toolgroup.cy.js +++ b/cypress/component/category-toolgroup.cy.js @@ -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(); });