feat(options): site-rule shortcut picker, chevrons, defaults and site-rule help copy

fix(inject,popup): isSpeederActiveForSite whitelist/blacklist; tests; clear activeSiteRule on no match
This commit is contained in:
joshpatra committed 2026-04-11 12:59:46 -04:00
1 parent 6d10a569d9
commit 4d37b4f570
10 files changed
+466 -101

No files matched your search

+22
View File
@@ -51,6 +51,28 @@ async function bootInject({ sync = {}, local = {} } = {}) {
}
describe("inject runtime", () => {
it("treats a matching site rule with site enabled as active when global enable is off", async () => {
await bootInject({
sync: {
enabled: false,
siteRules: [{ pattern: "example.org", enabled: true }]
}
});
expect(window.tc.settings.enabled).toBe(false);
window.captureSiteRuleBase();
window.applySiteRuleOverrides();
expect(window.tc.activeSiteRule).toEqual(
expect.objectContaining({ pattern: "example.org", enabled: true })
);
expect(
window.SpeederShared.siteRules.isSpeederActiveForSite(
window.tc.settings.enabled,
window.tc.activeSiteRule
)
).toBe(true);
});
it("keeps subtitle nudge disabled when the effective setting is off", async () => {
await bootInject({
sync: {