File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,35 @@ describe('<VueUiGalaxy />', () => {
3232 cy . get ( '[data-cy="datapoint-path"]' ) . should ( 'exist' ) . and ( 'be.visible' ) . and ( 'have.length' , dataset . length ) ;
3333 } ) ;
3434 } ) ;
35+
36+ it ( 'emits' , ( ) => {
37+ cy . mount ( VueUiGalaxy , {
38+ props : {
39+ config,
40+ dataset
41+ }
42+ } ) . then ( ( { wrapper } ) => {
43+ cy . log ( '@selectLegend' ) ;
44+ cy . get ( '[data-cy="legend-item-0"]' ) . click ( { force : true } ) . then ( ( ) => {
45+ expect ( wrapper . emitted ( 'selectLegend' ) ) . to . exist ;
46+ } )
47+
48+ cy . log ( '@selectDatapoint' ) ;
49+ cy . get ( '[data-cy="tooltip-trap"]' ) . first ( ) . click ( { force : true } ) . then ( ( ) => {
50+ expect ( wrapper . emitted ( 'selectDatapoint' ) ) . to . exist ;
51+ expect ( wrapper . emitted ( 'selectDatapoint' ) [ 0 ] [ 0 ] ) . to . have . keys (
52+ 'absoluteValues' ,
53+ 'color' ,
54+ 'id' ,
55+ 'name' ,
56+ 'path' ,
57+ 'points' ,
58+ 'proportion' ,
59+ 'seriesIndex' ,
60+ 'value'
61+ ) ;
62+ expect ( wrapper . emitted ( 'selectDatapoint' ) [ 0 ] [ 0 ] . seriesIndex ) . to . equal ( 1 ) ;
63+ } ) ;
64+ } ) ;
65+ } ) ;
3566} ) ;
You can’t perform that action at this time.
0 commit comments