mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
16 lines
551 B
TypeScript
16 lines
551 B
TypeScript
|
import { newSearchSelection, updateSearchSelection } from './selection';
|
||
|
|
||
|
describe('Search selection helper', () => {
|
||
|
it('simple dashboard selection', () => {
|
||
|
let sel = newSearchSelection();
|
||
|
expect(sel.isSelected('dash', 'aaa')).toBe(false);
|
||
|
|
||
|
sel = updateSearchSelection(sel, true, 'dash', ['aaa']);
|
||
|
expect(sel.isSelected('dash', 'aaa')).toBe(true);
|
||
|
|
||
|
sel = updateSearchSelection(sel, false, 'dash', ['aaa']);
|
||
|
expect(sel.isSelected('dash', 'aaa')).toBe(false);
|
||
|
expect(sel.items).toMatchInlineSnapshot(`Map {}`);
|
||
|
});
|
||
|
});
|