mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelChrome: Use react Panel Header for angular panels. (#21265)
* WIP: Angular panel chrome, this is going to be tricky * AngularPanelChrome: initial render works * Options are showing up * viz options working * Fixed singlestat background * AngularPanels: Fixed alert tab * Removed anuglar loading spinner * Dashboard: Refactor dashboard reducer & actions * Dashboard: minor refactoring * PanelChrome: loading state moved to header * Subscribe to render events to solve title update issue * Time info and query errors now works * PanelHeader: unifying angular and react behavior * added getPanelMenu test * Scrollable now works again * Various fixes * Making stuff work * seperate event emitter for angular * Fixed issue sending updated dimensions to angular panel * Minor tweaks * Fixed tests * Alerting: alert state now works * Fixed unit tests * Fixed a few null check errors * Simplified events handling * Fixed strict null checks
This commit is contained in:
@@ -22,31 +22,10 @@ import { PanelModel } from 'app/features/dashboard/state/PanelModel';
|
||||
import { MetricsPanelCtrl } from '../metrics_panel_ctrl';
|
||||
|
||||
describe('MetricsPanelCtrl', () => {
|
||||
describe('when getting additional menu items', () => {
|
||||
describe('and has no datasource set but user has access to explore', () => {
|
||||
it('should not return any items', async () => {
|
||||
const ctrl = setupController({ hasAccessToExplore: true });
|
||||
|
||||
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('and has datasource set that supports explore and user does not have access to explore', () => {
|
||||
it('should not return any items', async () => {
|
||||
const ctrl = setupController({ hasAccessToExplore: false });
|
||||
ctrl.datasource = { meta: { explore: true } } as any;
|
||||
|
||||
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('and has datasource set that supports explore and user has access to explore', () => {
|
||||
it('should return one item', async () => {
|
||||
const ctrl = setupController({ hasAccessToExplore: true });
|
||||
ctrl.datasource = { meta: { explore: true } } as any;
|
||||
|
||||
expect((await ctrl.getAdditionalMenuItems()).length).toBe(1);
|
||||
});
|
||||
describe('can setup', () => {
|
||||
it('should return controller', async () => {
|
||||
const ctrl = setupController({ hasAccessToExplore: true });
|
||||
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user