inital commit, very early alpha stage
This commit is contained in:
30
frontend/src/test/App.test.tsx
Normal file
30
frontend/src/test/App.test.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { App } from "../app/App";
|
||||
|
||||
describe("App", () => {
|
||||
it("renders the shell after dev bootstrap", async () => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
vi.fn()
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({ authenticated: true, dev_mode: true }), { status: 200 }))
|
||||
.mockResolvedValueOnce(
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
profile: { primary_display_name: "Anna Müller" },
|
||||
sections: { needs_me: [], today: [], changed: [], official_updates: [], catch_up: [] },
|
||||
connections: []
|
||||
}),
|
||||
{ status: 200 }
|
||||
)
|
||||
)
|
||||
);
|
||||
render(
|
||||
<MemoryRouter initialEntries={["/"]}>
|
||||
<App />
|
||||
</MemoryRouter>
|
||||
);
|
||||
expect(await screen.findByText("What needs attention")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user