File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11import { shallowMount } from "@vue/test-utils" ;
2+ import Sortable from "sortablejs" ;
3+
24import draggable from "@/vuedraggable" ;
35
46let wrapper ;
@@ -16,7 +18,7 @@ describe("draggable.vue", () => {
1618 } ,
1719 slots :{
1820 default : items . map ( item => `<div>${ item } </div>` ) ,
19- header : "<h1 />" ,
21+ header : "<header />" ,
2022 footer : "<footer/>"
2123 }
2224 } ) ;
@@ -77,10 +79,18 @@ describe("draggable.vue", () => {
7779 expect ( clone . default ( expected ) ) . toBe ( expected ) ;
7880 } )
7981
80- it ( "renders correctly" , ( ) => {
82+ it ( "renders root element correctly" , ( ) => {
8183 expect ( wrapper . html ( ) ) . toMatch ( / ^ < d i v > .* < \/ d i v > $ / ) ;
8284 } )
8385
86+ it ( "renders footer slot element correctly" , ( ) => {
87+ expect ( wrapper . html ( ) ) . toMatch ( / < f o o t e r > < \/ f o o t e r > < \/ d i v > $ / ) ;
88+ } )
89+
90+ it ( "renders header slot element correctly" , ( ) => {
91+ expect ( wrapper . html ( ) ) . toMatch ( / ^ < d i v > < h e a d e r > < \/ h e a d e r > / ) ;
92+ } )
93+
8494 test . each ( [
8595 "ul" ,
8696 "span" ,
You can’t perform that action at this time.
0 commit comments