From 68f6211aac4177f3a70a40031dabbd1b61840071 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Tue, 8 Oct 2019 13:08:29 +0000 Subject: Clean e2e tests --- e2e/lib/SettingRepository.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 e2e/lib/SettingRepository.ts (limited to 'e2e/lib/SettingRepository.ts') 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 { + await this.browser.storage.local.set({ + settings: { + source: SettingSource.JSON, + json: JSONTextSettings.fromSettings(settings).toJSONText(), + } + }); + } +} -- cgit v1.2.3