File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,38 @@ describe('<VueUiTreemap />', () => {
3838 cy . get ( '[data-cy="datapoint-rect"]' ) . should ( 'exist' ) . and ( 'be.visible' ) . and ( 'have.length' , 16 ) ;
3939 } ) ;
4040 } ) ;
41+
42+ it ( 'emits' , ( ) => {
43+ cy . mount ( VueUiTreemap , {
44+ props : {
45+ dataset,
46+ config
47+ }
48+ } ) . then ( ( { wrapper } ) => {
49+ cy . log ( '@selectLegend' ) ;
50+ cy . get ( '[data-cy="legend-item-0"]' ) . click ( ) . then ( ( ) => {
51+ expect ( wrapper . emitted ( 'selectLegend' ) ) . to . exist
52+ } ) ;
53+
54+ cy . log ( '@selectDatapoint' ) ;
55+ cy . get ( '[data-cy="datapoint-rect"]' ) . first ( ) . click ( { force : true } ) . then ( ( ) => {
56+ expect ( wrapper . emitted ( 'selectDatapoint' ) ) . to . exist
57+ expect ( wrapper . emitted ( 'selectDatapoint' ) [ 0 ] [ 0 ] ) . to . have . keys (
58+ 'children' ,
59+ 'color' ,
60+ 'id' ,
61+ 'name' ,
62+ 'normalizedValue' ,
63+ 'parentId' ,
64+ 'parentName' ,
65+ 'proportion' ,
66+ 'value' ,
67+ 'x0' ,
68+ 'x1' ,
69+ 'y0' ,
70+ 'y1'
71+ ) ;
72+ } ) ;
73+ } ) ;
74+ } ) ;
4175} ) ;
You can’t perform that action at this time.
0 commit comments