jquery.flot.fillbetween.Test.js 1.0 KB

123456789101112131415161718192021222324
  1. /* eslint-disable */
  2. /* global $, describe, it, xit, xdescribe, after, afterEach, expect*/
  3. describe('fillbetween plugin', function() {
  4. var placeholder, plot, options, dataset;
  5. beforeEach(function() {
  6. dataset = [
  7. { data: [[0, 2], [1, 2], [2, 4]], lines: { show: true }, color: "rgb(255,50,50)", id: "fillToPlot" },
  8. { data: [[0, 3], [1, 3], [2, 1]], lines: { show: true, lineWidth: 0, fill: 0.2 }, fillBetween: "fillToPlot", color: "rgb(255,50,50)" }
  9. ];
  10. placeholder = setFixtures('<div id="test-container" style="width: 600px;height: 400px">')
  11. .find('#test-container');
  12. });
  13. it('should fill between plots', function () {
  14. plot = $.plot(placeholder, dataset, options);
  15. var series = plot.getData();
  16. var points2 = series[1].datapoints.points;
  17. // second series will have 9 values instead of 6 where every third value is the first series y-value (for a particular datapoint)
  18. expect(points2).toEqual([0, 3, 2, 1, 3, 2, 2, 1, 4]);
  19. });
  20. });