CEC-4523: Add bulk archive support (#379)
* CEC-4523: add archive endpoint and action
This commit is contained in:
35
src/components/Manifest/List/index.test.jsx
Normal file
35
src/components/Manifest/List/index.test.jsx
Normal file
@@ -0,0 +1,35 @@
|
||||
jest.mock("../../Contexts/ManifestsContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
|
||||
import React from "react";
|
||||
import { render, screen, fireEvent } from "@testing-library/react";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import ManifestList from ".";
|
||||
import { TEST_AUTH_OBJECT_FISKER } from "../../../utils/testing";
|
||||
|
||||
const Page = (
|
||||
<UserProvider>
|
||||
<BrowserRouter>
|
||||
<StatusProvider>
|
||||
<ManifestList />
|
||||
</StatusProvider>
|
||||
</BrowserRouter>
|
||||
</UserProvider>
|
||||
);
|
||||
|
||||
describe("Manifest List Component", () => {
|
||||
beforeAll(() => {
|
||||
setToken(TEST_AUTH_OBJECT_FISKER);
|
||||
});
|
||||
|
||||
it("adjusts the active state on switch to archived tab", async () => {
|
||||
render(Page);
|
||||
|
||||
const archiveActionEl = screen.getByText("Archive");
|
||||
fireEvent.click(screen.getByText("Archived"));
|
||||
expect(archiveActionEl.innerHTML).toBe("Activate");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user