[filter_box] Fix ; separated filter_box default values (#8949)

This commit is contained in:
Grace Guo
2020-01-13 20:35:33 -08:00
committed by GitHub
parent b5e51ead29
commit 50f21cb7db
2 changed files with 27 additions and 2 deletions

View File

@@ -62,7 +62,26 @@ describe('getFilterConfigsFromFormdata', () => {
show_sqla_time_column: true,
});
expect(result.columns).toMatchObject({
state: 'CA',
state: ['CA'],
});
});
it('should read multi values from form_data', () => {
const result = getFilterConfigsFromFormdata({
...testFormdata,
filter_configs: [
{
asc: true,
clearable: true,
column: 'state',
defaultValue: 'CA;NY',
key: 'fvwncPjUf',
multiple: true,
},
],
});
expect(result.columns).toMatchObject({
state: ['CA', 'NY'],
});
});
});