data_processor_specs.ts 896 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ///<reference path="../../../../headers/common.d.ts" />
  2. import {describe, beforeEach, it, sinon, expect, angularMocks} from '../../../../../test/lib/common';
  3. import {DataProcessor} from '../data_processor';
  4. describe('Graph DataProcessor', function() {
  5. var panel: any = {
  6. xaxis: {}
  7. };
  8. var processor = new DataProcessor(panel);
  9. var seriesList;
  10. describe('Given default xaxis options and query that returns docs', () => {
  11. beforeEach(() => {
  12. panel.xaxis.mode = 'time';
  13. panel.xaxis.name = 'hostname';
  14. panel.xaxis.values = [];
  15. seriesList = processor.getSeriesList({
  16. dataList: [
  17. {
  18. type: 'docs',
  19. datapoints: [{hostname: "server1", avg: 10}]
  20. }
  21. ]
  22. });
  23. });
  24. it('Should automatically set xaxis mode to custom', () => {
  25. expect(panel.xaxis.mode).to.be('custom');
  26. });
  27. });
  28. });