Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |