mirror of
https://github.com/SoPat712/Speeder.git
synced 2026-10-08 19:05:02 -04:00
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:
10 files changed
+466
-101
No files matched your search
@@ -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: {
|
||||
|
||||
Reference in new issue
Block a user