diff options
Diffstat (limited to 'test/settings/reducers/setting.test.ts')
-rw-r--r-- | test/settings/reducers/setting.test.ts | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/test/settings/reducers/setting.test.ts b/test/settings/reducers/setting.test.ts index 34e76e2..85b55ee 100644 --- a/test/settings/reducers/setting.test.ts +++ b/test/settings/reducers/setting.test.ts @@ -1,6 +1,5 @@ import * as actions from "../../../src/settings/actions"; import settingReducer from "../../../src/settings/reducers/setting"; -import { expect } from "chai"; import { FormSettings, JSONTextSettings, @@ -11,8 +10,8 @@ import { DefaultSetting } from "../../../src/shared/settings/Settings"; describe("settings setting reducer", () => { it("return the initial state", () => { const state = settingReducer(undefined, {} as any); - expect(state).to.have.deep.property("source", "json"); - expect(state).to.have.deep.property("error", ""); + expect(state).toHaveProperty("source", "json"); + expect(state).toHaveProperty("error", ""); }); it("return next state for SETTING_SET_SETTINGS", () => { @@ -23,9 +22,9 @@ describe("settings setting reducer", () => { form: FormSettings.fromSettings(DefaultSetting), }; const state = settingReducer(undefined, action); - expect(state.source).to.equal("json"); - expect(state.json!.toJSONText()).to.equal('{ "key": "value" }'); - expect(state.form).to.deep.equal(action.form); + expect(state.source).toEqual("json"); + expect(state.json!.toJSONText()).toEqual('{ "key": "value" }'); + expect(state.form).toEqual(action.form); }); it("return next state for SETTING_SHOW_ERROR", () => { @@ -35,8 +34,8 @@ describe("settings setting reducer", () => { json: JSONTextSettings.fromText("{}"), }; const state = settingReducer(undefined, action); - expect(state.error).to.equal("bad value"); - expect(state.json!.toJSONText()).to.equal("{}"); + expect(state.error).toEqual("bad value"); + expect(state.json!.toJSONText()).toEqual("{}"); }); it("return next state for SETTING_SWITCH_TO_FORM", () => { @@ -45,8 +44,8 @@ describe("settings setting reducer", () => { form: FormSettings.fromSettings(DefaultSetting), }; const state = settingReducer(undefined, action); - expect(state.form).to.deep.equal(action.form); - expect(state.source).to.equal("form"); + expect(state.form).toEqual(action.form); + expect(state.source).toEqual("form"); }); it("return next state for SETTING_SWITCH_TO_JSON", () => { @@ -55,7 +54,7 @@ describe("settings setting reducer", () => { json: JSONTextSettings.fromText("{}"), }; const state = settingReducer(undefined, action); - expect(state.json!.toJSONText()).to.equal("{}"); - expect(state.source).to.equal(SettingSource.JSON); + expect(state.json!.toJSONText()).toEqual("{}"); + expect(state.source).toEqual(SettingSource.JSON); }); }); |