diff options
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(), |