mirror of
https://github.com/apache/superset.git
synced 2026-06-02 14:19:21 +00:00
fix(explore): Adhoc columns don't display correctly (#20802)
* fix(explore): Adhoc columns have empty labels * Add unit test * Address comments
This commit is contained in:
committed by
GitHub
parent
922b4b8d1d
commit
af1bddffad
@@ -27,7 +27,9 @@ const defaultProps: DndColumnSelectProps = {
|
||||
type: 'DndColumnSelect',
|
||||
name: 'Filter',
|
||||
onChange: jest.fn(),
|
||||
options: { string: { column_name: 'Column A' } },
|
||||
options: {
|
||||
string: { column_name: 'Column A' },
|
||||
},
|
||||
actions: { setControlValue: jest.fn() },
|
||||
};
|
||||
|
||||
@@ -42,3 +44,19 @@ test('renders with value', () => {
|
||||
});
|
||||
expect(screen.getByText('Column A')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders adhoc column', () => {
|
||||
render(
|
||||
<DndColumnSelect
|
||||
{...defaultProps}
|
||||
value={{
|
||||
sqlExpression: 'Count *',
|
||||
label: 'adhoc column',
|
||||
expressionType: 'SQL',
|
||||
}}
|
||||
/>,
|
||||
{ useDnd: true },
|
||||
);
|
||||
expect(screen.getByText('adhoc column')).toBeVisible();
|
||||
expect(screen.getByLabelText('calculator')).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user