mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-04-26 13:32:40 -04:00
25 lines
896 B
TypeScript
25 lines
896 B
TypeScript
// This file is part of Moonfire NVR, a security camera network video recorder.
|
|
// Copyright (C) 2021 The Moonfire NVR Authors; see AUTHORS and LICENSE.txt.
|
|
// SPDX-License-Identifier: GPL-v3.0-or-later WITH GPL-3.0-linking-exception
|
|
|
|
import { screen } from "@testing-library/react";
|
|
import App from "./App";
|
|
import { renderWithCtx } from "./testutil";
|
|
import { rest } from "msw";
|
|
import { setupServer } from "msw/node";
|
|
import { beforeAll, afterAll, afterEach, expect, test } from "vitest";
|
|
|
|
const server = setupServer(
|
|
rest.get("/api/", (req, res, ctx) => {
|
|
return res(ctx.status(503), ctx.text("server error"));
|
|
})
|
|
);
|
|
beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
|
|
afterEach(() => server.resetHandlers());
|
|
afterAll(() => server.close());
|
|
|
|
test("instantiate", async () => {
|
|
renderWithCtx(<App />);
|
|
expect(screen.getByText(/Moonfire NVR/)).toBeInTheDocument();
|
|
});
|