@@ -92,21 +92,21 @@ test('should render the title', async () => {
92
92
expect ( screen . getByText ( `Drill to detail: ${ chartName } ` ) ) . toBeInTheDocument ( ) ;
93
93
} ) ;
94
94
95
- test ( 'should not render Edit chart button when no drill-through chart is configured' , async ( ) => {
95
+ test ( 'should not render Explore button when no drill-through chart is configured' , async ( ) => {
96
96
await renderModal ( ) ;
97
97
expect (
98
- screen . queryByRole ( 'button' , { name : 'Edit chart ' } ) ,
98
+ screen . queryByRole ( 'button' , { name : 'Explore ' } ) ,
99
99
) . not . toBeInTheDocument ( ) ;
100
100
expect ( screen . getAllByRole ( 'button' , { name : 'Close' } ) ) . toHaveLength ( 2 ) ;
101
101
} ) ;
102
102
103
- test ( 'should render Edit chart link when drill-through chart is configured' , async ( ) => {
103
+ test ( 'should render Explore button when drill-through chart is configured' , async ( ) => {
104
104
const datasetWithDrillThrough = {
105
105
drill_through_chart_id : 123 ,
106
106
id : 456 , // Required for URL generation
107
107
} ;
108
108
await renderModal ( { } , datasetWithDrillThrough ) ;
109
- expect ( screen . getByRole ( 'link ' , { name : 'Edit chart ' } ) ) . toBeInTheDocument ( ) ;
109
+ expect ( screen . getByRole ( 'button ' , { name : 'Explore ' } ) ) . toBeInTheDocument ( ) ;
110
110
expect ( screen . getAllByRole ( 'button' , { name : 'Close' } ) ) . toHaveLength ( 2 ) ;
111
111
} ) ;
112
112
@@ -117,23 +117,7 @@ test('should close the modal', async () => {
117
117
expect ( screen . queryByRole ( 'dialog' ) ) . not . toBeInTheDocument ( ) ;
118
118
} ) ;
119
119
120
- test ( 'should have correct href for drill-through chart' , async ( ) => {
121
- const drillThroughChartId = 123 ;
122
- const datasetId = 456 ;
123
- const datasetWithDrillThrough = {
124
- drill_through_chart_id : drillThroughChartId ,
125
- id : datasetId ,
126
- } ;
127
- await renderModal ( { } , datasetWithDrillThrough ) ;
128
- const editLink = screen . getByRole ( 'link' , { name : 'Edit chart' } ) ;
129
- expect ( editLink ) . toHaveAttribute (
130
- 'href' ,
131
- `/explore/?dashboard_page_id=&slice_id=${ drillThroughChartId } ` ,
132
- ) ;
133
- expect ( editLink ) . not . toHaveAttribute ( 'target' ) ; // We removed target="_blank"
134
- } ) ;
135
-
136
- test ( 'should render "Edit chart" as disabled without can_explore permission' , async ( ) => {
120
+ test ( 'should render "Explore" as disabled without can_explore permission' , async ( ) => {
137
121
const datasetWithDrillThrough = {
138
122
drill_through_chart_id : 123 ,
139
123
id : 456 , // Required for URL generation
@@ -147,5 +131,5 @@ test('should render "Edit chart" as disabled without can_explore permission', as
147
131
} ,
148
132
datasetWithDrillThrough ,
149
133
) ;
150
- expect ( screen . getByRole ( 'button' , { name : 'Edit chart ' } ) ) . toBeDisabled ( ) ;
134
+ expect ( screen . getByRole ( 'button' , { name : 'Explore ' } ) ) . toBeDisabled ( ) ;
151
135
} ) ;
0 commit comments