Migrating NVD3 Area's stacked_style config (#9454)

* Migrating NVD3 Area's stacked_style config

* test mods

* lint

* nonsense change

* undoing nonsense. Come on GitHub, WORK.
This commit is contained in:
Evan Rusackas
2020-04-03 12:50:28 -07:00
committed by GitHub
parent cd572334c9
commit 265a2feb29
4 changed files with 42 additions and 17 deletions

View File

@@ -57,6 +57,23 @@ describe('controlUtils', () => {
},
},
],
[
{
name: 'stacked_style',
config: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
},
},
],
],
},
],
@@ -148,10 +165,15 @@ describe('controlUtils', () => {
});
it('removes missing/invalid choice', () => {
let control = getControlState('stacked_style', 'area', state, 'stack');
let control = getControlState(
'stacked_style',
'test-chart',
state,
'stack',
);
expect(control.value).toBe('stack');
control = getControlState('stacked_style', 'area', state, 'FOO');
control = getControlState('stacked_style', 'test-chart', state, 'FOO');
expect(control.value).toBe(null);
});