Covering cacheable preferences into tests

This commit is contained in:
koloml committed 2026-06-20 22:03:11 +04:00
1 parent b905ed668c
commit 74554bc9f6
3 files changed
+177 -3

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ export default class ConfigurationController {
return;
}
callback(changes[this.#configurationName].newValue);
callback(changes[this.#configurationName].newValue as Record<string, any>);
}
this.#storage.subscribe(subscriber);
@@ -95,10 +95,11 @@ export default abstract class CacheablePreferences<Fields> {
/**
* @param settingsNamespace Name of the field inside the extension storage where these preferences stored.
* @param [controller] Configuration controller. If not provided, default controller will be used.
* @protected
*/
protected constructor(settingsNamespace: string) {
this.#controller = new ConfigurationController(settingsNamespace);
protected constructor(settingsNamespace: string, controller: ConfigurationController = new ConfigurationController(settingsNamespace)) {
this.#controller = controller;
this.#disposables.push(
this.#controller.subscribeToChanges(settings => {