diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-02-03 21:28:12 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-02-03 21:55:47 +0900 |
commit | 4d5573356e30721431b74351d93691d6ce4da4a8 (patch) | |
tree | 0a5b8605627d3b122f912eab813da136d02e56aa /e2e | |
parent | 818ba9ea1a6c46036a7ed448861217e63d3aa5be (diff) |
Store settings in sync storage
Diffstat (limited to 'e2e')
-rw-r--r-- | e2e/follow_properties.test.ts | 31 | ||||
-rw-r--r-- | e2e/lib/SettingRepository.ts | 2 |
2 files changed, 14 insertions, 19 deletions
diff --git a/e2e/follow_properties.test.ts b/e2e/follow_properties.test.ts index bbd46d4..78597a5 100644 --- a/e2e/follow_properties.test.ts +++ b/e2e/follow_properties.test.ts @@ -6,6 +6,8 @@ import eventually from './eventually'; import { Builder, Lanthan } from 'lanthan'; import { WebDriver, Key } from 'selenium-webdriver'; import Page from './lib/Page'; +import SettingRepository from "./lib/SettingRepository"; +import Settings from "../src/shared/settings/Settings"; describe('follow properties test', () => { const server = new TestServer().receiveContent('/', ` @@ -31,24 +33,17 @@ describe('follow properties test', () => { webdriver = lanthan.getWebDriver(); browser = lanthan.getWebExtBrowser(); - await browser.storage.local.set({ settings: { - source: 'json', - json: `{ - "keymaps": { - ":": { "type": "command.show" }, - "f": { "type": "follow.start", "newTab": false }, - "F": { "type": "follow.start", "newTab": true, "background": false }, - "<C-F>": { "type": "follow.start", "newTab": true, "background": true } - }, - "search": { - "default": "google", - "engines": { "google": "https://google.com/search?q={}" } - }, - "properties": { - "hintchars": "jk" - } - }`, - }}); + await new SettingRepository(browser).saveJSON(Settings.fromJSON({ + "keymaps": { + ":": { "type": "command.show" }, + "f": { "type": "follow.start", "newTab": false }, + "F": { "type": "follow.start", "newTab": true, "background": false }, + "<C-F>": { "type": "follow.start", "newTab": true, "background": true } + }, + "properties": { + "hintchars": "jk" + } + })); await server.start(); }); diff --git a/e2e/lib/SettingRepository.ts b/e2e/lib/SettingRepository.ts index 9d5d5aa..3bdf6d2 100644 --- a/e2e/lib/SettingRepository.ts +++ b/e2e/lib/SettingRepository.ts @@ -8,7 +8,7 @@ export default class SettingRepository { } async saveJSON(settings: Settings): Promise<void> { - await this.browser.storage.local.set({ + await this.browser.storage.sync.set({ settings: { source: SettingSource.JSON, json: JSONTextSettings.fromSettings(settings).toJSONText(), |