debian-mirror-gitlab/spec/frontend/operation_settings/store/mutations_spec.js

30 lines
903 B
JavaScript
Raw Normal View History

2021-03-11 19:13:27 +05:30
import { timezones } from '~/monitoring/format_date';
2019-09-04 21:01:54 +05:30
import mutations from '~/operation_settings/store/mutations';
import createState from '~/operation_settings/store/state';
describe('operation settings mutations', () => {
let localState;
beforeEach(() => {
localState = createState();
});
describe('SET_EXTERNAL_DASHBOARD_URL', () => {
it('sets externalDashboardUrl', () => {
const mockUrl = 'mockUrl';
mutations.SET_EXTERNAL_DASHBOARD_URL(localState, mockUrl);
2020-06-23 00:09:42 +05:30
expect(localState.externalDashboard.url).toBe(mockUrl);
});
});
describe('SET_DASHBOARD_TIMEZONE', () => {
it('sets dashboardTimezoneSetting', () => {
mutations.SET_DASHBOARD_TIMEZONE(localState, timezones.LOCAL);
expect(localState.dashboardTimezone.selected).not.toBeUndefined();
expect(localState.dashboardTimezone.selected).toBe(timezones.LOCAL);
2019-09-04 21:01:54 +05:30
});
});
});