From e2541df313c1b85b42c5d5cdc0bc793225e2352d Mon Sep 17 00:00:00 2001 From: Hillary Jeffrey Date: Tue, 4 Feb 2020 11:00:58 -0500 Subject: [PATCH] Update tests to remove deprecated functions --- .../unit/components/users_invite.spec.jsx | 55 ++----------------- .../unit/components/users_selector.spec.jsx | 16 ------ 2 files changed, 4 insertions(+), 67 deletions(-) diff --git a/static_src/test/unit/components/users_invite.spec.jsx b/static_src/test/unit/components/users_invite.spec.jsx index cc697ebf..225d34e7 100644 --- a/static_src/test/unit/components/users_invite.spec.jsx +++ b/static_src/test/unit/components/users_invite.spec.jsx @@ -21,36 +21,13 @@ describe("", function() { wrapper = shallow(); }); - it("renders one
component", () => { - expect(wrapper.find(Form).length).toEqual(1); - }); - - it("renders one component", () => { - expect(wrapper.find(Action).length).toEqual(1); - }); - describe("conditional documentation based on inviteEntityType", () => { it("refers to `space` when type is space", () => { const doc = - "Invite a new user to cloud.gov and this space" + - " or add an existing user to this space."; - - expect( - wrapper - .find(PanelDocumentation) - .find("p") - .text() - ).toBe(doc); - }); - - it("refers to `organization` when type is organization", () => { - const doc = - "Invite a new user to cloud.gov and this organization" + - " or add an existing user to this organization."; - const orgProps = Object.assign({}, props, { - inviteEntityType: "organization" - }); - wrapper = shallow(); + "NOTE: Use the new dashboard to add a new or existing user" + + " to this space, as we deprecate this dashboard. See our " + + "updated documentation on how to manage user access and "+ + "roles here."; expect( wrapper @@ -59,30 +36,6 @@ describe("", function() { .text() ).toBe(doc); }); - - it("refers to `organization` when type is organization in the action button", () => { - const buttonHTML = - '"; - const orgProps = Object.assign({}, props, { - inviteEntityType: "organization" - }); - wrapper = shallow(); - - expect(wrapper.find(Action).html()).toEqual(buttonHTML); - }); - }); - }); - - describe("when user does not have ability to invite other users", () => { - it("does not render component", () => { - const noAccessProps = Object.assign({}, props, { - currentUserAccess: false - }); - wrapper = shallow(); - - expect(wrapper.find(Form).length).toEqual(0); }); }); }); diff --git a/static_src/test/unit/components/users_selector.spec.jsx b/static_src/test/unit/components/users_selector.spec.jsx index 6b52bfdb..9cac66c3 100644 --- a/static_src/test/unit/components/users_selector.spec.jsx +++ b/static_src/test/unit/components/users_selector.spec.jsx @@ -20,22 +20,6 @@ describe("", function() { }; let wrapper; - describe("when the working description is displayed as text panel", () => { - beforeEach(() => { - wrapper = shallow(); - }); - - it("displays proper message", () => { - const doc = "Invite an existing organization user to this space."; - expect( - wrapper - .find(PanelDocumentation) - .find("p") - .text() - ).toBe(doc); - }); - }); - describe("when user selector", () => { it("renders users", () => { const username = "username";