File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,25 @@ describe('compile/mark/encode/tooltip', () => {
8383 expect ( props . tooltip ) . toEqual ( { signal : 'datum.datum' } ) ;
8484 } ) ;
8585
86+ it ( 'generates tooltip signal for discrete encodings without a format and reactiveGeom is true' , ( ) => {
87+ const model = parseUnitModelWithScaleAndLayoutSize ( {
88+ mark : {
89+ type : 'circle' ,
90+ tooltip : true ,
91+ } ,
92+ encoding : {
93+ color : {
94+ field : 'Foobar' ,
95+ type : 'nominal' ,
96+ } ,
97+ } ,
98+ } ) ;
99+ expect ( tooltip ( model , { reactiveGeom : true } ) . tooltip ) . toEqual ( {
100+ signal :
101+ '{"Foobar": isValid(datum.datum["Foobar"]) ? isArray(datum.datum["Foobar"]) ? join(datum.datum["Foobar"], \'\\n\') : datum.datum["Foobar"] : ""+datum.datum["Foobar"]}' ,
102+ } ) ;
103+ } ) ;
104+
86105 it ( 'priorizes tooltip field def' , ( ) => {
87106 const model = parseUnitModelWithScaleAndLayoutSize ( {
88107 mark : { type : 'point' , tooltip : { content : 'data' } } ,
You can’t perform that action at this time.
0 commit comments