Linting tests
This commit is contained in:
@@ -10,10 +10,10 @@ describe("Test AddFruit component.", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
actions = {
|
||||
addFruit: jest.fn(),
|
||||
addFruit: jest.fn()
|
||||
};
|
||||
mutations = {
|
||||
toggleModal: jest.fn(),
|
||||
toggleModal: jest.fn()
|
||||
};
|
||||
store = new Vuex.Store({ actions, mutations });
|
||||
});
|
||||
@@ -27,14 +27,14 @@ describe("Test AddFruit component.", () => {
|
||||
const wrapper = shallowMount(AddFruit, { store, localVue });
|
||||
expect(wrapper.vm.$data.fruit).toEqual({
|
||||
color: "#000000",
|
||||
isFruit: true,
|
||||
isFruit: true
|
||||
});
|
||||
});
|
||||
|
||||
it("closes AddFruit modal on Cancel click.", () => {
|
||||
const wrapper = shallowMount(AddFruit, {
|
||||
store,
|
||||
localVue,
|
||||
localVue
|
||||
});
|
||||
const cancelBtn = wrapper.find(".btn--cancel");
|
||||
cancelBtn.trigger("click");
|
||||
@@ -44,7 +44,7 @@ describe("Test AddFruit component.", () => {
|
||||
it("dispatches addFruit action on form submission.", () => {
|
||||
const wrapper = shallowMount(AddFruit, {
|
||||
store,
|
||||
localVue,
|
||||
localVue
|
||||
});
|
||||
const form = wrapper.find("form");
|
||||
form.trigger("submit");
|
||||
@@ -54,7 +54,7 @@ describe("Test AddFruit component.", () => {
|
||||
it("checks that 'is-overlayed' class is added/removed to <body> on mounted/destroy.", () => {
|
||||
const wrapper = shallowMount(AddFruit, {
|
||||
store,
|
||||
localVue,
|
||||
localVue
|
||||
});
|
||||
expect(document.body.classList).toContain("is-overlayed");
|
||||
wrapper.destroy();
|
||||
|
||||
Reference in New Issue
Block a user