CodeWithPravinMaske commented on code in PR #45619:
URL: https://github.com/apache/superset/pull/45619#discussion_r4374259799
##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -520,3 +520,75 @@ test('Export All Data JPEG screenshot passes
addWarningToast to downloadAsImage'
mockAddWarningToast,
);
});
+
+test('A Big Number chart keeps only the image exports in Data Export Options',
async () => {
+ render(
+ <TestComponent
+ {...defaultProps}
+ latestQueryFormData={{
+ datasource: '1__table',
+ viz_type: 'big_number_total',
+ }}
+ />,
+ {
+ useRedux: true,
+ initialState: { explore: { can_export_image: true } },
+ },
+ );
+
+ await userEvent.hover(await screen.findByText('Data Export Options'));
+ await userEvent.hover(await screen.findByText('Export All Data'));
+ expect(
+ await screen.findByText('Export screenshot (jpeg)'),
+ ).toBeInTheDocument();
+ expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+ expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+ expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+ expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();
+});
+
+test('A Big Number chart keeps only the image exports in Export Current View',
async () => {
+ render(
+ <TestComponent
+ {...defaultProps}
+ latestQueryFormData={{
+ datasource: '1__table',
+ viz_type: 'big_number_total',
+ }}
+ />,
+ {
+ useRedux: true,
+ initialState: { explore: { can_export_image: true } },
+ },
+ );
+
+ await userEvent.hover(await screen.findByText('Data Export Options'));
+ await userEvent.hover(await screen.findByText('Export Current View'));
+ expect(
+ await screen.findByText('Export screenshot (jpeg)'),
+ ).toBeInTheDocument();
+ expect(screen.getByText('Export screenshot (png)')).toBeInTheDocument();
+ expect(screen.queryByText('Export to .CSV')).not.toBeInTheDocument();
+ expect(screen.queryByText('Export to Excel')).not.toBeInTheDocument();
+ expect(screen.queryByText('Export as PDF')).not.toBeInTheDocument();
Review Comment:
Added Export to .JSON absence assertions to both image-only submenu tests
(Export All Data and Export Current View).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]