donal
2018-03-23 a34f1d0a99d257c0a25418cd5cdcf65e74dfd07b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { shallow } from "@vue/test-utils";
import NewTodo from "@/components/NewTodo.vue";
// import { expect } from 'chai'
 
import * as all from "../unit/setup.js";
 
describe("NewTodo.vue", () => {
  it("renders props.placeholderMsg when passed", () => {
    const msg = "Add a Todo";
    const wrapper = shallow(NewTodo, {
      propsData: { placeholderMsg: msg }
    });
    expect(wrapper.vm._props.placeholderMsg).toMatch(msg);
  });
 
  it("renders newTodo as empty string", () => {
    const wrapper = shallow(NewTodo, {});
    expect(wrapper.vm.newTodo).toMatch("");
  });
 
});