donal
2018-04-16 78a403c450425ea86fad7df5737a4a53ed4c6714
tests/unit/vue-components/TodoItem.spec.js
@@ -19,7 +19,7 @@
    const wrapper = shallow(TodoItem, {
      propsData: { todoItem }
    });
    expect(wrapper.element).toMatchSnapshot();
    // expect(wrapper.element).toMatchSnapshot();
  });
  it("Renders title as 'Love Front End testing :)'", () => {
@@ -55,14 +55,12 @@
      propsData: { todoItem: importantTodo }
    });
    // TODO - test goes here!
    expect(wrapper.find(".important-flag").exists()).toBe(true);
  });
  it("should set the colour to red when true", () => {
    const wrapper = mount(TodoItem, {
      propsData: { todoItem: importantTodo }
    });
    // TODO - test goes here!
    expect(wrapper.find(".red-flag").exists()).toBe(true);
  });
  it("should set the colour to not red when false", () => {
    importantTodo.important = false;
@@ -70,7 +68,6 @@
      propsData: { todoItem: importantTodo }
    });
    // TODO - test goes here!
    expect(wrapper.find(".red-flag").exists()).toBe(false);
  });
  it("call makImportant when clicked", () => {
@@ -79,8 +76,5 @@
      propsData: { todoItem: importantTodo }
    });
    // TODO - test goes here!
    const input = wrapper.find(".important-flag");
    input.trigger("click");
    expect(methods.markImportant).toHaveBeenCalled();
  });
});