File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
webview/src/experiments/components Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -897,6 +897,42 @@ describe('App', () => {
897897 type : MessageFromWebviewType . TOGGLE_EXPERIMENT_STAR
898898 } )
899899 } )
900+
901+ it ( 'should toggle the star status of multiple experiments by clicking the ctx menu options' , ( ) => {
902+ render ( < App /> )
903+
904+ fireEvent (
905+ window ,
906+ new MessageEvent ( 'message' , {
907+ data : {
908+ data : {
909+ ...tableDataFixture ,
910+ hasRunningExperiment : false
911+ } ,
912+ type : MessageToWebviewType . SET_DATA
913+ }
914+ } )
915+ )
916+
917+ mockPostMessage . mockReset ( )
918+ const mainRow = getRow ( 'main' )
919+ fireEvent . click ( mainRow )
920+
921+ const firstTipRow = getRow ( '4fb124a' )
922+ fireEvent . click ( firstTipRow )
923+
924+ fireEvent . contextMenu ( mainRow , { bubbles : true } )
925+ jest . advanceTimersByTime ( 100 )
926+
927+ const starOption = screen . getByText ( 'Star Experiments (2)' )
928+ fireEvent . click ( starOption )
929+
930+ expect ( mockPostMessage ) . toBeCalledTimes ( 1 )
931+ expect ( mockPostMessage ) . toBeCalledWith ( {
932+ payload : [ 'main' , 'exp-e7a67' ] ,
933+ type : MessageFromWebviewType . TOGGLE_EXPERIMENT_STAR
934+ } )
935+ } )
900936 } )
901937
902938 describe ( 'Context Menu Suppression' , ( ) => {
You can’t perform that action at this time.
0 commit comments