mirror of
https://github.com/apache/superset.git
synced 2026-04-13 21:24:28 +00:00
feat(explore): export csv data pivoted for Pivot Table [ID-9] (#17512)
* feat(explore): export csv data pivoted for Pivot Table * Implement dropdown with download csv options * Change label to "Original" * Add tests * Add form data to query context * Add form data to query context generator * Explicitly make form_data optional
This commit is contained in:
committed by
GitHub
parent
b2ffa268cd
commit
07e8837093
@@ -82,4 +82,36 @@ describe('ExploreActionButtons', () => {
|
||||
spyExportChart.restore();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Dropdown csv button when viz type is pivot table', () => {
|
||||
let wrapper;
|
||||
const defaultProps = {
|
||||
actions: {},
|
||||
canDownloadCSV: false,
|
||||
latestQueryFormData: { viz_type: 'pivot_table_v2' },
|
||||
queryEndpoint: 'localhost',
|
||||
chartHeight: '30px',
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(
|
||||
<ThemeProvider theme={supersetTheme}>
|
||||
<ExploreActionButtons {...defaultProps} />
|
||||
</ThemeProvider>,
|
||||
{
|
||||
wrappingComponent: Provider,
|
||||
wrappingComponentProps: {
|
||||
store: mockStore,
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should render a dropdown button when viz type is pivot table', () => {
|
||||
const csvTrigger = wrapper.find(
|
||||
'div[role="button"] span[aria-label="caret-down"]',
|
||||
);
|
||||
expect(csvTrigger).toExist();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user