Spaces:
Sleeping
Sleeping
File size: 1,059 Bytes
097eaf0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | import { shouldCheckRobots } from "../shouldCheckRobots";
describe("shouldCheckRobots", () => {
it("returns false when lockdown is true, even if the team flag is set", () => {
expect(
shouldCheckRobots(
{ lockdown: true },
{ teamFlags: { checkRobotsOnScrape: true } as any },
),
).toBe(false);
});
it("returns false when the team flag is off, regardless of lockdown", () => {
expect(
shouldCheckRobots(
{ lockdown: false },
{ teamFlags: { checkRobotsOnScrape: false } as any },
),
).toBe(false);
expect(
shouldCheckRobots({ lockdown: true }, { teamFlags: {} as any }),
).toBe(false);
});
it("returns false when teamFlags is missing", () => {
expect(shouldCheckRobots({ lockdown: false }, {})).toBe(false);
});
it("returns true only when the team flag is on and lockdown is off", () => {
expect(
shouldCheckRobots(
{ lockdown: false },
{ teamFlags: { checkRobotsOnScrape: true } as any },
),
).toBe(true);
});
});
|