@@ -139,6 +139,11 @@ describe('timeline/GlobalTrack', function () {
139139 container . querySelector ( '.timelineTrackLabel' ) ,
140140 `Couldn't find the track label with selector .timelineTrackLabel`
141141 ) as HTMLElement ;
142+ const getGlobalTrackContent = ( ) =>
143+ ensureExists (
144+ container . querySelector ( '.timelineTrackTrack' ) ,
145+ `Couldn't find the track content with selector .timelineTrackTrack`
146+ ) as HTMLElement ;
142147 const getGlobalTrackRow = ( ) =>
143148 ensureExists (
144149 container . querySelector ( '.timelineTrackGlobalRow' ) ,
@@ -155,6 +160,7 @@ describe('timeline/GlobalTrack', function () {
155160 trackIndex,
156161 threadIndex,
157162 getGlobalTrackLabel,
163+ getGlobalTrackContent,
158164 getGlobalTrackRow,
159165 } ;
160166 }
@@ -222,7 +228,7 @@ describe('timeline/GlobalTrack', function () {
222228 expect ( getGlobalTrackRow ( ) ) . toHaveClass ( 'selected' ) ;
223229 } ) ;
224230
225- it ( 'can right click a thread' , ( ) => {
231+ it ( 'can right click a thread on the label ' , ( ) => {
226232 const { getState, getGlobalTrackLabel, threadIndex, trackReference } =
227233 setup ( ) ;
228234
@@ -231,13 +237,22 @@ describe('timeline/GlobalTrack', function () {
231237 expect ( getFirstSelectedThreadIndex ( getState ( ) ) ) . not . toBe ( threadIndex ) ;
232238 } ) ;
233239
234- it ( 'can select a thread by clicking the row ' , ( ) => {
235- const { getState, getGlobalTrackRow , threadIndex } = setup ( ) ;
240+ it ( 'can select a thread by clicking the track content ' , ( ) => {
241+ const { getState, getGlobalTrackContent , threadIndex } = setup ( ) ;
236242 expect ( getFirstSelectedThreadIndex ( getState ( ) ) ) . not . toBe ( threadIndex ) ;
237- fireFullClick ( getGlobalTrackRow ( ) ) ;
243+ fireFullClick ( getGlobalTrackContent ( ) ) ;
238244 expect ( getFirstSelectedThreadIndex ( getState ( ) ) ) . toBe ( threadIndex ) ;
239245 } ) ;
240246
247+ it ( 'can right click a thread on the track content' , ( ) => {
248+ const { getState, getGlobalTrackContent, threadIndex, trackReference } =
249+ setup ( ) ;
250+
251+ fireFullContextMenu ( getGlobalTrackContent ( ) ) ;
252+ expect ( getRightClickedTrack ( getState ( ) ) ) . toEqual ( trackReference ) ;
253+ expect ( getFirstSelectedThreadIndex ( getState ( ) ) ) . not . toBe ( threadIndex ) ;
254+ } ) ;
255+
241256 it ( 'will render a stub div if the track is hidden' , ( ) => {
242257 const { container, trackIndex, dispatch } = setup ( ) ;
243258 act ( ( ) => {
0 commit comments