aboutsummaryrefslogtreecommitdiff
path: root/test/settings/components/form
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-10-07 12:54:32 +0000
committerGitHub <noreply@github.com>2019-10-07 12:54:32 +0000
commit8eddcc1785a85bbe74be254d1055ebe5125dad10 (patch)
treef3f51320d12a90a1b421ed8b1f811c576996ea8e /test/settings/components/form
parent7fc2bb615f530fc6adfade54b9553568f5d50ceb (diff)
parentb77a4734985722e96066e713f3b1b9e81a6e1811 (diff)
Merge pull request #654 from ueokande/settings-as-a-class
Refactor settings on shared logics
Diffstat (limited to 'test/settings/components/form')
-rw-r--r--test/settings/components/form/KeymapsForm.test.tsx4
-rw-r--r--test/settings/components/form/PropertiesForm.test.tsx4
-rw-r--r--test/settings/components/form/SearchEngineForm.test.tsx8
3 files changed, 8 insertions, 8 deletions
diff --git a/test/settings/components/form/KeymapsForm.test.tsx b/test/settings/components/form/KeymapsForm.test.tsx
index dc2322b..1d1e77c 100644
--- a/test/settings/components/form/KeymapsForm.test.tsx
+++ b/test/settings/components/form/KeymapsForm.test.tsx
@@ -9,7 +9,7 @@ import { expect } from 'chai';
describe("settings/form/KeymapsForm", () => {
describe('render', () => {
it('renders keymap fields', () => {
- let root = ReactTestRenderer.create(<KeymapsForm value={FormKeymaps.valueOf({
+ let root = ReactTestRenderer.create(<KeymapsForm value={FormKeymaps.fromJSON({
'scroll.vertically?{"count":1}': 'j',
'scroll.vertically?{"count":-1}': 'k',
})} />).root
@@ -48,7 +48,7 @@ describe("settings/form/KeymapsForm", () => {
it('invokes onChange event on edit', (done) => {
ReactTestUtils.act(() => {
ReactDOM.render(<KeymapsForm
- value={FormKeymaps.valueOf({
+ value={FormKeymaps.fromJSON({
'scroll.vertically?{"count":1}': 'j',
'scroll.vertically?{"count":-1}': 'k',
})}
diff --git a/test/settings/components/form/PropertiesForm.test.tsx b/test/settings/components/form/PropertiesForm.test.tsx
index 80f60d2..0e33cc8 100644
--- a/test/settings/components/form/PropertiesForm.test.tsx
+++ b/test/settings/components/form/PropertiesForm.test.tsx
@@ -13,14 +13,14 @@ describe("settings/form/PropertiesForm", () => {
mybool: 'boolean',
empty: 'string',
}
- let value = {
+ let values = {
mystr: 'abc',
mynum: 123,
mybool: true,
};
let root = ReactTestRenderer.create(
- <PropertiesForm types={types} value={value} />,
+ <PropertiesForm types={types} value={values} />,
).root
let input = root.findByProps({ name: 'mystr' });
diff --git a/test/settings/components/form/SearchEngineForm.test.tsx b/test/settings/components/form/SearchEngineForm.test.tsx
index 0e6b17d..1f0420d 100644
--- a/test/settings/components/form/SearchEngineForm.test.tsx
+++ b/test/settings/components/form/SearchEngineForm.test.tsx
@@ -8,7 +8,7 @@ import { FormSearch } from 'shared/SettingData';
describe("settings/form/SearchForm", () => {
describe('render', () => {
it('renders SearchForm', () => {
- let root = ReactTestRenderer.create(<SearchForm value={FormSearch.valueOf({
+ let root = ReactTestRenderer.create(<SearchForm value={FormSearch.fromJSON({
default: 'google',
engines: [['google', 'google.com'], ['yahoo', 'yahoo.com']],
})} />).root;
@@ -41,7 +41,7 @@ describe("settings/form/SearchForm", () => {
it('invokes onChange event on edit', (done) => {
ReactTestUtils.act(() => {
ReactDOM.render(<SearchForm
- value={FormSearch.valueOf({
+ value={FormSearch.fromJSON({
default: 'google',
engines: [['google', 'google.com'], ['yahoo', 'yahoo.com']]
})}
@@ -67,7 +67,7 @@ describe("settings/form/SearchForm", () => {
it('invokes onChange event on delete', (done) => {
ReactTestUtils.act(() => {
- ReactDOM.render(<SearchForm value={FormSearch.valueOf({
+ ReactDOM.render(<SearchForm value={FormSearch.fromJSON({
default: 'yahoo',
engines: [['louvre', 'google.com'], ['yahoo', 'yahoo.com']]
})}
@@ -88,7 +88,7 @@ describe("settings/form/SearchForm", () => {
it('invokes onChange event on add', (done) => {
ReactTestUtils.act(() => {
- ReactDOM.render(<SearchForm value={FormSearch.valueOf({
+ ReactDOM.render(<SearchForm value={FormSearch.fromJSON({
default: 'yahoo',
engines: [['google', 'google.com']]
})}