mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 02:17:53 +01:00
Prepare 4.0.5 Firefox update and Shorts fixes
Add Firefox data consent, repair contributor sign-in, and introduce optional Hide clutter buttons. Harden video navigation, voting, and action layouts with shared browser regression coverage and reproducible release packaging.
This commit is contained in:
1 parent
3657de9b2c
commit
e500088e65
196 files changed
+39706
-2694
No files matched your search
@@ -0,0 +1,35 @@
|
||||
const { assertExactSuccessfulVotesTraffic } = require("./hermetic-api-contract");
|
||||
|
||||
const VIDEO_A = "abcdefghijk";
|
||||
const VIDEO_B = "zyxwvutsrqp";
|
||||
|
||||
function votes(videoId, overrides = {}) {
|
||||
return {
|
||||
method: "GET",
|
||||
pathname: "/votes",
|
||||
query: { videoId },
|
||||
respondedAt: 123,
|
||||
responseStatus: 200,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
test("accepts the exact ordered successful /votes sequence", () => {
|
||||
const records = [
|
||||
{ method: "GET", pathname: "/configs/selectors", responseStatus: 200 },
|
||||
votes(VIDEO_A),
|
||||
votes(VIDEO_B),
|
||||
];
|
||||
|
||||
expect(assertExactSuccessfulVotesTraffic(records, [VIDEO_A, VIDEO_B])).toEqual(records.slice(1));
|
||||
});
|
||||
|
||||
test.each([
|
||||
["missing request", [votes(VIDEO_A)], /missing, duplicate, or stale/],
|
||||
["duplicate request", [votes(VIDEO_A), votes(VIDEO_B), votes(VIDEO_B)], /missing, duplicate, or stale/],
|
||||
["stale video ID", [votes(VIDEO_A), votes("stalevid001")], /missing, duplicate, or stale/],
|
||||
["non-200 response", [votes(VIDEO_A), votes(VIDEO_B, { responseStatus: 204 })], /did not receive HTTP 200/],
|
||||
["unfinished response", [votes(VIDEO_A), votes(VIDEO_B, { respondedAt: undefined })], /did not finish/],
|
||||
])("rejects a %s", (_label, records, expectedError) => {
|
||||
expect(() => assertExactSuccessfulVotesTraffic(records, [VIDEO_A, VIDEO_B], "Shared runtime")).toThrow(expectedError);
|
||||
});
|
||||
Reference in new issue
Block a user