Clean up useMuteStates test (#2891)

We don't need to be mocking React for this test.
This commit is contained in:
Hugh Nimmo-Smith
2024-12-13 10:09:27 +00:00
committed by GitHub
parent 1cbb6dff81
commit 7807c44fdc

View File

@@ -6,8 +6,7 @@ Please see LICENSE in the repository root for full details.
*/ */
import { afterAll, afterEach, describe, expect, it, vi } from "vitest"; import { afterAll, afterEach, describe, expect, it, vi } from "vitest";
import React, { type ReactNode } from "react"; import { type ReactNode } from "react";
import { beforeEach } from "vitest";
import { render, screen } from "@testing-library/react"; import { render, screen } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom"; import { MemoryRouter } from "react-router-dom";
@@ -92,16 +91,12 @@ function mockMediaDevices(
} }
describe("useMuteStates", () => { describe("useMuteStates", () => {
beforeEach(() => {
vi.spyOn(React, "useContext").mockReturnValue({});
});
afterEach(() => { afterEach(() => {
vi.restoreAllMocks(); vi.clearAllMocks();
}); });
afterAll(() => { afterAll(() => {
vi.clearAllMocks(); vi.resetAllMocks();
}); });
it("disabled when no input devices", () => { it("disabled when no input devices", () => {