Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hyvyys committed Sep 2, 2019
1 parent 7b0db4f commit c02d5e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 38 deletions.
25 changes: 25 additions & 0 deletions tests/unit/Settings.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { mount } from "@vue/test-utils";
import Settings from "@/components/Settings.vue";
import SettingDefinitions from "@/models/Settings";

describe("Settings.vue", () => {
it("can change font size", async () => {
const mockStore = {
getters: {
settings: SettingDefinitions.getDefaults(),
},
commit: jest.fn(),
};

const wrapper = mount(Settings, {
mocks: {
$store: mockStore,
},
});

const newFontSize = 36;
wrapper.vm.$refs.settingFontSize.$emit("input", newFontSize);
await wrapper.vm.$nextTick();
expect(mockStore.commit).toHaveBeenCalledWith("updateSettings", { fontSize: 36 });
});
});
26 changes: 0 additions & 26 deletions tests/unit/Settings.spec_.js

This file was deleted.

12 changes: 0 additions & 12 deletions tests/unit/example._spec_.js

This file was deleted.

0 comments on commit c02d5e8

Please sign in to comment.