mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Eslint: no-duplicate-imports rule (bump grafana-eslint-config) * Chore: Fix duplicate imports (#31041) * Rebased this branch into eslint-no-duplicate-imports * updated some changes * merged uncaught duplicate imports * fixes frontend test- I hope * fixes e2e test- I hope Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { SeriesOverridesCtrl } from '../series_overrides_ctrl';
|
|
|
|
describe('SeriesOverridesCtrl', () => {
|
|
const popoverSrv = {};
|
|
let $scope: any;
|
|
|
|
beforeEach(() => {
|
|
$scope = {
|
|
ctrl: {
|
|
refresh: jest.fn(),
|
|
render: jest.fn(),
|
|
seriesList: [],
|
|
},
|
|
render: jest.fn(() => {}),
|
|
};
|
|
SeriesOverridesCtrl($scope, {} as JQuery, popoverSrv);
|
|
});
|
|
|
|
describe('When setting an override', () => {
|
|
beforeEach(() => {
|
|
$scope.setOverride({ propertyName: 'lines' }, { value: true });
|
|
});
|
|
|
|
it('should set override property', () => {
|
|
expect($scope.override.lines).toBe(true);
|
|
});
|
|
|
|
it('should update view model', () => {
|
|
expect($scope.currentOverrides[0].name).toBe('Lines');
|
|
expect($scope.currentOverrides[0].value).toBe('true');
|
|
});
|
|
});
|
|
|
|
describe('When removing overide', () => {
|
|
it('click should include option and value index', () => {
|
|
$scope.setOverride(1, 0);
|
|
$scope.removeOverride({ propertyName: 'lines' });
|
|
expect($scope.currentOverrides.length).toBe(0);
|
|
});
|
|
});
|
|
});
|