-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93039ec
commit 66e8b9a
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { http } from "msw"; | ||
import { HttpResponse } from "msw"; | ||
import { render, screen, waitFor } from "@/tests"; | ||
import server from "@/tests/mocks/node"; | ||
import BlacklistSeriesView from "."; | ||
|
||
/* eslint-disable camelcase */ | ||
describe("Blacklist Series", () => { | ||
it("should render without blacklisted series", async () => { | ||
server.use( | ||
http.get("/api/episodes/blacklist", () => { | ||
return HttpResponse.json({ | ||
data: [], | ||
}); | ||
}), | ||
); | ||
|
||
render(<BlacklistSeriesView />); | ||
|
||
await waitFor(() => { | ||
expect( | ||
screen.getByText("No blacklisted series subtitles"), | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it("should render with blacklisted series", async () => { | ||
server.use( | ||
http.get("/api/episodes/blacklist", () => { | ||
// TODO: Replace with Factory | ||
return HttpResponse.json({ | ||
data: [ | ||
{ | ||
seriesTitle: "Dragon Ball DAIMA", | ||
episode_number: "1x14", | ||
episodeTitle: "Taboo", | ||
sonarrSeriesId: 56, | ||
provider: "animetosho", | ||
subs_id: | ||
"https://animetosho.org/storage/attach/0022fd50/2293072.xz", | ||
language: { | ||
name: "English", | ||
code2: "en", | ||
code3: "eng", | ||
forced: false, | ||
hi: false, | ||
}, | ||
timestamp: "now", | ||
parsed_timestamp: "01/24/25 01:38:03", | ||
}, | ||
], | ||
}); | ||
}), | ||
); | ||
|
||
render(<BlacklistSeriesView />); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText("animetosho")).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); |