acammies
2018-04-09 7a7144da66cf5070aee1d23ae695b6291a0deb2e
added more tests
2 files deleted
1 files modified
75 ■■■■■ changed files
tests/unit/HelloWorld.spec.js 12 ●●●●● patch | view | raw | blame | history
tests/unit/NewTodoList.spec.js 21 ●●●●● patch | view | raw | blame | history
tests/unit/TodoItem.spec.js 42 ●●●● patch | view | raw | blame | history
tests/unit/HelloWorld.spec.js
File was deleted
tests/unit/NewTodoList.spec.js
File was deleted
tests/unit/TodoItem.spec.js
@@ -7,24 +7,42 @@
describe("TodoItem.vue", () => {
  
  it("has the expected html structure", () => {
    const todoItem = { };
    const todoItem = {};
    const wrapper = shallow(TodoItem, { 
      propsData: { todoItem } 
    });
    expect(wrapper.element).toMatchSnapshot();
  });
  
  // it("has the expected html structure", () => {
  //   const todoItem = {
  //     completed: false,
  //     title: "",
  //     important: false
  //   };
  //   const wrapper = shallow(TodoItem, {
  //     propsData: { todoItem }
  //   });
  //   expect(wrapper.element).toMatchSnapshot();
  // });
  it("Renders title as 'TestTitle'", () => {
    const todoItem = {
      title: "TestTitle"
    };
    const wrapper = shallow(TodoItem, {
      propsData: { todoItem }
    });
    expect(wrapper.vm.todoItem.title).toMatch("TestTitle");
  });
  it("Renders completed as true", () => {
    const todoItem = {
      completed : true
    };
    const wrapper = shallow(TodoItem, {
      propsData: { todoItem }
    });
    expect(wrapper.vm.todoItem.completed).toEqual(true);
  });
  it("Renders important as false", () => {
    const todoItem = {
      important : false
    };
    const wrapper = shallow(TodoItem, {
      propsData: { todoItem }
    });
    expect(wrapper.vm.todoItem.important).toEqual(false);
  });
  
  // it("renders props.placeholderMsg when passed", () => {
  //   const msg = "Add a Todo";