mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Revert "Revert "LibraryPanel: Fallback to panel title if library panel title …"
This reverts commit 6e705ee67c.
30 lines
926 B
TypeScript
30 lines
926 B
TypeScript
import { VizPanel } from '@grafana/scenes';
|
|
|
|
import { LibraryPanelBehavior } from '../scene/LibraryPanelBehavior';
|
|
|
|
import { PanelModelCompatibilityWrapper } from './PanelModelCompatibilityWrapper';
|
|
|
|
describe('PanelModelCompatibilityWrapper', () => {
|
|
it('Can get legacy id', () => {
|
|
const vizPanel = new VizPanel({ pluginId: 'test', title: 'test', description: 'test', key: 'panel-24' });
|
|
const panelModel = new PanelModelCompatibilityWrapper(vizPanel);
|
|
expect(panelModel.id).toBe(24);
|
|
});
|
|
|
|
it('Can get legacy id for lib panel', () => {
|
|
const panel = new VizPanel({ pluginId: 'test', title: 'test', description: 'test', key: 'panel-24' });
|
|
|
|
const libPanel = new LibraryPanelBehavior({
|
|
uid: 'a',
|
|
name: 'aa',
|
|
});
|
|
|
|
panel.setState({
|
|
$behaviors: [libPanel],
|
|
});
|
|
|
|
const panelModel = new PanelModelCompatibilityWrapper(panel);
|
|
expect(panelModel.id).toBe(24);
|
|
});
|
|
});
|