mirror of
https://github.com/grafana/grafana.git
synced 2025-01-28 17:24:59 -06:00
21 lines
608 B
TypeScript
21 lines
608 B
TypeScript
import { ResourceDimensionMode } from '@grafana/schema';
|
|
|
|
import { getResourceDimension } from './resource';
|
|
|
|
describe('getResourceDimension', () => {
|
|
const publicPath = '/public/';
|
|
beforeAll(() => {
|
|
window.__grafana_public_path__ = publicPath;
|
|
});
|
|
|
|
it('fixed mode', () => {
|
|
const frame = undefined;
|
|
const fixedValue = 'img/icons/unicons/question-circle.svg';
|
|
const config = { mode: ResourceDimensionMode.Fixed, fixed: fixedValue };
|
|
|
|
expect(getResourceDimension(frame, config).fixed).toEqual(publicPath + fixedValue);
|
|
});
|
|
|
|
// TODO: write tests for field and mapping modes
|
|
});
|