From a3421427b862876d80d47cc69a000800ec5e44cd Mon Sep 17 00:00:00 2001 From: Kevin Tun Date: Sun, 18 Feb 2024 22:45:25 -0600 Subject: [PATCH] chore(InfoPageViewToolbar.test.tsx): delete unused test file The InfoPageViewToolbar.test.tsx file was deleted as it was no longer needed and contained tests that were not relevant to the current functionality. --- .../InfoPageViewToolbar.test.tsx | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 apps/dicty-frontpage/src/features/EditablePages/InfoPageViewToolbar.test.tsx diff --git a/apps/dicty-frontpage/src/features/EditablePages/InfoPageViewToolbar.test.tsx b/apps/dicty-frontpage/src/features/EditablePages/InfoPageViewToolbar.test.tsx deleted file mode 100644 index d7a9452900..0000000000 --- a/apps/dicty-frontpage/src/features/EditablePages/InfoPageViewToolbar.test.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import React from "react" -import { render, screen } from "@testing-library/react" -import userEvent from "@testing-library/user-event" -import { vi } from "vitest" -import { MockAuthProvider } from "../../mocks/MockAuthProvider" -import { InfoPageViewToolbar } from "./InfoPageViewToolbar" - -describe("EditablePages/InfoPageViewToolbar", () => { - describe("user has editing permission and verified token", () => { - const mockHandleClick = vi.fn() - const properties = { - lastUpdate: "2020-01-01T17:50:12.427Z", - user: { - id: "1234", - - firstName: "Art", - - lastName: "Vandelay", - email: "art@vandelayindustries.com", - roles: [ - { - name: "Latex Salesman", - }, - ], - }, - handleClick: mockHandleClick, - } - - it("displays expected name", () => { - render( - - - , - ) - const text = screen.getByTestId("info-page-toolbar") - expect(text).toHaveTextContent("Art Vandelay edited") - }) - it("calls handleClick when edit icon clicked", async () => { - render( - - - , - ) - const user = userEvent.setup() - const button = screen.getByRole("button") - await user.click(button) - expect(mockHandleClick).toHaveBeenCalledTimes(1) - }) - }) - - describe("user has editing permission and expired token", () => { - const properties = { - lastUpdate: "2020-01-01T17:50:12.427Z", - user: { - id: "1234", - - firstName: "Art", - - lastName: "Vandelay", - email: "art@vandelayindustries.com", - roles: [ - { - name: "Latex Salesman", - }, - ], - }, - handleClick: vi.fn(), - } - - it("renders expected error message", () => { - render( - - - , - ) - expect( - screen.getByText( - /Your login token has expired. Please log out and then log back in to regain full user access./, - ), - ).toBeInTheDocument() - }) - it("does not render edit button", () => { - render( - - - , - ) - const editButton = screen.queryByRole("button") - expect(editButton).not.toBeInTheDocument() - }) - }) -})