From 4d5573356e30721431b74351d93691d6ce4da4a8 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 3 Feb 2020 21:28:12 +0900 Subject: Store settings in sync storage --- e2e/follow_properties.test.ts | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'e2e/follow_properties.test.ts') 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 }, - "": { "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 }, + "": { "type": "follow.start", "newTab": true, "background": true } + }, + "properties": { + "hintchars": "jk" + } + })); await server.start(); }); -- cgit v1.2.3