mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[filter_box] dashboard should carry defaultValue in filter_box (#8812)
This commit is contained in:
@@ -20,6 +20,16 @@ import getFilterConfigsFromFormdata from '../../../../src/dashboard/util/getFilt
|
||||
|
||||
describe('getFilterConfigsFromFormdata', () => {
|
||||
const testFormdata = {
|
||||
filter_configs: [
|
||||
{
|
||||
asc: true,
|
||||
clearable: true,
|
||||
column: 'state',
|
||||
defaultValue: 'CA',
|
||||
key: 'fvwncPjUf',
|
||||
multiple: true,
|
||||
},
|
||||
],
|
||||
date_filter: true,
|
||||
granularity_sqla: '__time',
|
||||
time_grain_sqla: 'P1M',
|
||||
@@ -45,4 +55,14 @@ describe('getFilterConfigsFromFormdata', () => {
|
||||
__time_col: testFormdata.granularity_sqla,
|
||||
});
|
||||
});
|
||||
|
||||
it('should use default value from form_data', () => {
|
||||
const result = getFilterConfigsFromFormdata({
|
||||
...testFormdata,
|
||||
show_sqla_time_column: true,
|
||||
});
|
||||
expect(result.columns).toMatchObject({
|
||||
state: 'CA',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user