Skip to content

Commit

Permalink
chore: move test files
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-oki committed Jan 24, 2025
1 parent 6e33a9e commit 9bcedf6
Show file tree
Hide file tree
Showing 15 changed files with 290 additions and 214 deletions.
33 changes: 33 additions & 0 deletions frontend/src/pages/History/Movies/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import MoviesHistoryView from ".";

describe("History Movies", () => {
it("should render with movies", async () => {
server.use(
http.get("/api/movies/history", () => {
return HttpResponse.json({
data: [],
});
}),
);
server.use(
http.get("/api/providers", () => {
return HttpResponse.json({
data: [],
});
}),
);
server.use(
http.get("/api/system/languages", () => {
return HttpResponse.json({});
}),
);

render(<MoviesHistoryView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/History/Series/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SeriesHistoryView from ".";

describe("History Series", () => {
it("should render with series", async () => {
server.use(
http.get("/api/episodes/history", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SeriesHistoryView />);

// TODO: Assert
});
});
39 changes: 39 additions & 0 deletions frontend/src/pages/History/Statistics/HistoryStats.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import HistoryStats from "./HistoryStats";

describe("History Stats", () => {
it("should render with stats", async () => {
server.use(
http.get("/api/providers", () => {
return HttpResponse.json({
data: [],
});
}),
);
server.use(
http.get("/api/system/languages", () => {
return HttpResponse.json({});
}),
);
server.use(
http.get("/api/history/stats", () => {
return HttpResponse.json({
data: [],
});
}),
);

server.use(
http.get("/api/system/providers", () => {
return HttpResponse.json({});
}),
);

render(<HistoryStats />);

// TODO: Assert
});
});
63 changes: 0 additions & 63 deletions frontend/src/pages/History/history.test.tsx

This file was deleted.

21 changes: 21 additions & 0 deletions frontend/src/pages/System/Announcements/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemAnnouncementsView from ".";

describe("System Announcements", () => {
it("should render with announcements", async () => {
server.use(
http.get("/api/system/announcements", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemAnnouncementsView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/System/Backups/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemBackupsView from ".";

describe("System Backups", () => {
it("should render with backups", async () => {
server.use(
http.get("/api/system/backups", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemBackupsView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/System/Logs/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemLogsView from ".";

describe("System Logs", () => {
it("should render with logs", async () => {
server.use(
http.get("/api/system/logs", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemLogsView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/System/Providers/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemProvidersView from ".";

describe("System Providers", () => {
it("should render with providers", async () => {
server.use(
http.get("/api/providers", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemProvidersView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/System/Releases/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemReleasesView from ".";

describe("System Releases", () => {
it("should render with releases", async () => {
server.use(
http.get("/api/system/releases", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemReleasesView />);

// TODO: Assert
});
});
29 changes: 29 additions & 0 deletions frontend/src/pages/System/Status/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemStatusView from ".";

describe("System Status", () => {
it("should render with status", async () => {
server.use(
http.get("/api/system/status", () => {
return HttpResponse.json({
data: [],
});
}),
);

server.use(
http.get("/api/system/health", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemStatusView />);

// TODO: Assert
});
});
21 changes: 21 additions & 0 deletions frontend/src/pages/System/Tasks/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { http } from "msw";
import { HttpResponse } from "msw";
import { render } from "@/tests";
import server from "@/tests/mocks/node";
import SystemTasksView from ".";

describe("System Tasks", () => {
it("should render with tasks", async () => {
server.use(
http.get("/api/system/tasks", () => {
return HttpResponse.json({
data: [],
});
}),
);

render(<SystemTasksView />);

// TODO: Assert
});
});
Loading

0 comments on commit 9bcedf6

Please sign in to comment.