aboutsummaryrefslogtreecommitdiff
path: root/e2e/lib
diff options
context:
space:
mode:
Diffstat (limited to 'e2e/lib')
-rw-r--r--e2e/lib/SettingRepository.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/e2e/lib/SettingRepository.ts b/e2e/lib/SettingRepository.ts
new file mode 100644
index 0000000..9d5d5aa
--- /dev/null
+++ b/e2e/lib/SettingRepository.ts
@@ -0,0 +1,18 @@
+import { JSONTextSettings, SettingSource } from '../../src/shared/SettingData';
+import Settings from '../../src/shared/settings/Settings';
+
+export default class SettingRepository {
+ constructor(
+ private readonly browser: any,
+ ) {
+ }
+
+ async saveJSON(settings: Settings): Promise<void> {
+ await this.browser.storage.local.set({
+ settings: {
+ source: SettingSource.JSON,
+ json: JSONTextSettings.fromSettings(settings).toJSONText(),
+ }
+ });
+ }
+}