2017-09-10 17:25:29 +05:30
|
|
|
import MonitoringStore from '~/monitoring/stores/monitoring_store';
|
|
|
|
import MonitoringMock, { deploymentData } from './mock_data';
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
describe('MonitoringStore', function () {
|
2017-09-10 17:25:29 +05:30
|
|
|
this.store = new MonitoringStore();
|
|
|
|
this.store.storeMetrics(MonitoringMock.data);
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
it('contains one group that contains two queries sorted by priority', () => {
|
2017-09-10 17:25:29 +05:30
|
|
|
expect(this.store.groups).toBeDefined();
|
|
|
|
expect(this.store.groups.length).toEqual(1);
|
2018-03-17 18:26:18 +05:30
|
|
|
expect(this.store.groups[0].metrics.length).toEqual(2);
|
2017-09-10 17:25:29 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('gets the metrics count for every group', () => {
|
|
|
|
expect(this.store.getMetricsCount()).toEqual(2);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains deployment data', () => {
|
|
|
|
this.store.storeDeploymentData(deploymentData);
|
|
|
|
expect(this.store.deploymentData).toBeDefined();
|
|
|
|
expect(this.store.deploymentData.length).toEqual(3);
|
|
|
|
expect(typeof this.store.deploymentData[0]).toEqual('object');
|
|
|
|
});
|
|
|
|
});
|