‰PNG  IHDRèèÂÁC³×IDATxÚíÖ1 À°ù7 89šTÁ®5<'wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ; wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ»`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸KÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãHÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãHÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜÀ¸Æ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`ÜãÆ0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãw0î€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŒ;wÀ¸€qŒ;`ÜÀ¸Æ0î`Üãw0î€qãwÀ¸€qŒ;`ÜÀ¸ÆŒ;`ÜãÆ0î€qãwÀ¸€qŒ;wÀ¸ÆŒ;`ÜãÆ0î`Üãw0î€qŽºÆá¾d“é­IEND®B`‚ FM / test
/home/wespack/public_html/admin/vendors/Chart.js/test
NameSizeModeActions
controller.bar.tests.js114470644editdlrm
controller.bubble.tests.js99790644editdlrm
controller.doughnut.tests.js103510644editdlrm
controller.line.tests.js132210644editdlrm
controller.polarArea.tests.js88900644editdlrm
controller.radar.tests.js140310644editdlrm
core.element.tests.js12840644editdlrm
core.helpers.tests.js187720644editdlrm
core.layoutService.tests.js72580644editdlrm
core.legend.tests.js62970644editdlrm
core.plugin.tests.js10830644editdlrm
core.scaleService.tests.js7370644editdlrm
core.title.tests.js41130644editdlrm
defaultConfig.tests.js65770644editdlrm
element.arc.tests.js35150644editdlrm
element.line.tests.js191150644editdlrm
element.point.tests.js93460644editdlrm
element.rectangle.tests.js67510644editdlrm
mockContext.js61680644editdlrm
scale.category.tests.js97720644editdlrm
scale.linear.tests.js174670644editdlrm
scale.logarithmic.tests.js131790644editdlrm
scale.radialLinear.tests.js103400644editdlrm
scale.time.tests.js117410644editdlrm
Edit: /home/wespack/public_html/admin/vendors/Chart.js/test/element.rectangle.tests.js (6751B)
// Test the rectangle element describe('Rectangle element tests', function() { it ('Should be constructed', function() { var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); expect(rectangle).not.toBe(undefined); expect(rectangle._datasetIndex).toBe(2); expect(rectangle._index).toBe(1); }); it ('Should correctly identify as in range', function() { var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Safely handles if these are called before the viewmodel is instantiated expect(rectangle.inRange(5)).toBe(false); expect(rectangle.inLabelRange(5)).toBe(false); // Attach a view object as if we were the controller rectangle._view = { base: 0, width: 4, x: 10, y: 15 }; expect(rectangle.inRange(10, 15)).toBe(true); expect(rectangle.inRange(10, 10)).toBe(true); expect(rectangle.inRange(10, 16)).toBe(false); expect(rectangle.inRange(5, 5)).toBe(false); expect(rectangle.inLabelRange(5)).toBe(false); expect(rectangle.inLabelRange(7)).toBe(false); expect(rectangle.inLabelRange(10)).toBe(true); expect(rectangle.inLabelRange(12)).toBe(true); expect(rectangle.inLabelRange(15)).toBe(false); expect(rectangle.inLabelRange(20)).toBe(false); // Test when the y is below the base (negative bar) var negativeRectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Attach a view object as if we were the controller negativeRectangle._view = { base: 0, width: 4, x: 10, y: -15 }; expect(negativeRectangle.inRange(10, -16)).toBe(false); expect(negativeRectangle.inRange(10, 1)).toBe(false); expect(negativeRectangle.inRange(10, -5)).toBe(true); }); it ('should get the correct height', function() { var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Attach a view object as if we were the controller rectangle._view = { base: 0, width: 4, x: 10, y: 15 }; expect(rectangle.height()).toBe(-15); // Test when the y is below the base (negative bar) var negativeRectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Attach a view object as if we were the controller negativeRectangle._view = { base: -10, width: 4, x: 10, y: -15 }; expect(negativeRectangle.height()).toBe(5); }); it ('should get the correct tooltip position', function() { var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Attach a view object as if we were the controller rectangle._view = { base: 0, width: 4, x: 10, y: 15 }; expect(rectangle.tooltipPosition()).toEqual({ x: 10, y: 15, }); // Test when the y is below the base (negative bar) var negativeRectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1 }); // Attach a view object as if we were the controller negativeRectangle._view = { base: -10, width: 4, x: 10, y: -15 }; expect(negativeRectangle.tooltipPosition()).toEqual({ x: 10, y: -15, }); }); it ('should draw correctly', function() { var mockContext = window.createMockContext(); var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1, _chart: { ctx: mockContext, } }); // Attach a view object as if we were the controller rectangle._view = { backgroundColor: 'rgb(255, 0, 0)', base: 0, borderColor: 'rgb(0, 0, 255)', borderWidth: 1, ctx: mockContext, width: 4, x: 10, y: 15, }; rectangle.draw(); expect(mockContext.getCalls()).toEqual([{ name: 'beginPath', args: [], }, { name: 'setFillStyle', args: ['rgb(255, 0, 0)'] }, { name: 'setStrokeStyle', args: ['rgb(0, 0, 255)'], }, { name: 'setLineWidth', args: [1] }, { name: 'moveTo', args: [8.5, 0] }, { name: 'lineTo', args: [8.5, 15.5] }, { name: 'lineTo', args: [11.5, 15.5] }, { name: 'lineTo', args: [11.5, 0] }, { name: 'fill', args: [], }, { name: 'stroke', args: [] }]); }); it ('should draw correctly with no stroke', function() { var mockContext = window.createMockContext(); var rectangle = new Chart.elements.Rectangle({ _datasetIndex: 2, _index: 1, _chart: { ctx: mockContext, } }); // Attach a view object as if we were the controller rectangle._view = { backgroundColor: 'rgb(255, 0, 0)', base: 0, borderColor: 'rgb(0, 0, 255)', ctx: mockContext, width: 4, x: 10, y: 15, }; rectangle.draw(); expect(mockContext.getCalls()).toEqual([{ name: 'beginPath', args: [], }, { name: 'setFillStyle', args: ['rgb(255, 0, 0)'] }, { name: 'setStrokeStyle', args: ['rgb(0, 0, 255)'], }, { name: 'setLineWidth', args: [undefined] }, { name: 'moveTo', args: [8, 0] }, { name: 'lineTo', args: [8, 15] }, { name: 'lineTo', args: [12, 15] }, { name: 'lineTo', args: [12, 0] }, { name: 'fill', args: [], }]); }); function testBorderSkipped (borderSkipped, expectedDrawCalls) { var mockContext = window.createMockContext(); var rectangle = new Chart.elements.Rectangle({ _chart: { ctx: mockContext } }); // Attach a view object as if we were the controller rectangle._view = { borderSkipped: borderSkipped, // set tested 'borderSkipped' parameter ctx: mockContext, base: 0, width: 4, x: 10, y: 15, }; rectangle.draw(); var drawCalls = rectangle._view.ctx.getCalls().splice(4, 4); expect(drawCalls).toEqual(expectedDrawCalls); } it ('should draw correctly respecting "borderSkipped" == "bottom"', function() { testBorderSkipped ('bottom', [ { name: 'moveTo', args: [8, 0] }, { name: 'lineTo', args: [8, 15] }, { name: 'lineTo', args: [12, 15] }, { name: 'lineTo', args: [12, 0] }, ]); }); it ('should draw correctly respecting "borderSkipped" == "left"', function() { testBorderSkipped ('left', [ { name: 'moveTo', args: [8, 15] }, { name: 'lineTo', args: [12, 15] }, { name: 'lineTo', args: [12, 0] }, { name: 'lineTo', args: [8, 0] }, ]); }); it ('should draw correctly respecting "borderSkipped" == "top"', function() { testBorderSkipped ('top', [ { name: 'moveTo', args: [12, 15] }, { name: 'lineTo', args: [12, 0] }, { name: 'lineTo', args: [8, 0] }, { name: 'lineTo', args: [8, 15] }, ]); }); it ('should draw correctly respecting "borderSkipped" == "right"', function() { testBorderSkipped ('right', [ { name: 'moveTo', args: [12, 0] }, { name: 'lineTo', args: [8, 0] }, { name: 'lineTo', args: [8, 15] }, { name: 'lineTo', args: [12, 15] }, ]); }); });