File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export const TourRoot = ({ tour }: TourRootProps) => {
128
128
doneLabel : tour . getOption ( "doneLabel" ) ,
129
129
hideNext : tour . getOption ( "hideNext" ) ,
130
130
hidePrev : tour . getOption ( "hidePrev" ) ,
131
- className : tour . getOption ( "tooltipClass" ) ,
131
+ className : step . val . tooltipClass || tour . getOption ( "tooltipClass" ) ,
132
132
progress : tour . getOption ( "showProgress" ) ,
133
133
progressBarAdditionalClass : tour . getOption (
134
134
"progressBarAdditionalClass"
Original file line number Diff line number Diff line change @@ -129,4 +129,27 @@ context("Modal", () => {
129
129
} ) ;
130
130
} ) ;
131
131
} ) ;
132
+
133
+ it ( "should apply tooltipClass from step configuration over tour tooltipClass" , ( ) => {
134
+ cy . visit ( "./cypress/setup/index.html" ) . then ( ( win ) => {
135
+ cy . viewport ( "macbook-13" ) ;
136
+
137
+ const instance = win . introJs . tour ( ) . setOptions ( {
138
+ tooltipClass : "tour-tooltip" ,
139
+ steps : [
140
+ {
141
+ element : "#main-section" ,
142
+ intro : "step tooltip class" ,
143
+ tooltipClass : "step-tooltip" ,
144
+ } ,
145
+ ] ,
146
+ } ) ;
147
+ instance . refresh ( true ) ;
148
+ instance . start ( ) ;
149
+
150
+ cy . get ( ".introjs-tooltip" )
151
+ . should ( "have.class" , "step-tooltip" )
152
+ . should ( "not.have.class" , "tour-tooltip" ) ;
153
+ } ) ;
154
+ } ) ;
132
155
} ) ;
You can’t perform that action at this time.
0 commit comments