diff --git a/packages/scenes/src/variables/variants/MultiValueVariable.test.ts b/packages/scenes/src/variables/variants/MultiValueVariable.test.ts index 9f9876779..39e6d3b54 100644 --- a/packages/scenes/src/variables/variants/MultiValueVariable.test.ts +++ b/packages/scenes/src/variables/variants/MultiValueVariable.test.ts @@ -305,6 +305,19 @@ describe('MultiValueVariable', () => { expect(variable.getValueText()).toBe(ALL_VARIABLE_TEXT); }); + it('GetValueText should return value if text is an empty string', async () => { + const variable = new TestVariable({ + name: 'test', + options: [], + optionsToReturn: [], + value: 'MyValue', + text: '', + delayMs: 0, + }); + + expect(variable.getValueText()).toBe('MyValue'); + }); + it('GetValue should return all options as an array when value is $__all', async () => { const variable = new TestVariable({ name: 'test', diff --git a/packages/scenes/src/variables/variants/MultiValueVariable.ts b/packages/scenes/src/variables/variants/MultiValueVariable.ts index b89ab3b4a..b088b802f 100644 --- a/packages/scenes/src/variables/variants/MultiValueVariable.ts +++ b/packages/scenes/src/variables/variants/MultiValueVariable.ts @@ -161,6 +161,10 @@ export abstract class MultiValueVariable