Skip to content

Commit

Permalink
Added a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Aug 11, 2018
1 parent 65424f3 commit c72f06f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/unit/TaskList.spec.js
@@ -0,0 +1,15 @@
import Vue from "vue";
import TaskList from "../../src/components/TaskList.vue";
import { withPinnedTasks } from "../../src/components/TaskList.stories";

it("renders pinned tasks at the start of the list", () => {
const Constructor = Vue.extend(TaskList);
const vm = new Constructor({
propsData: { tasks: withPinnedTasks }
}).$mount();
const lastTaskInput = vm.$el.querySelector(
".list-item:nth-child(1).TASK_PINNED"
);

// We expect the pinned task to be rendered first, not at the end
expect(lastTaskInput).not.toBe(null);

0 comments on commit c72f06f

Please sign in to comment.