Commit Graph

19 Commits

Author SHA1 Message Date
Jukka Kurkela
0d0481d64c
Fix DomPlatform.isAttached (#9448) 2021-07-23 08:28:09 +03:00
Jukka Kurkela
8d6e87881a
Relocate chart type and dataset type defaults (#8563)
* Relocate chart type and dataset type defaults

* Update types

* Separate overrides and descriptors

* Update derived sample, use merge for inherit

* Don't merge overrides

* Review update
2021-03-06 10:34:52 -05:00
Jukka Kurkela
a8329e4f13
Update chartjs-test-utils to v0.2.1 (#8407)
* Update chartjs-test-utils to v0.2.0

* to 0.2.1
2021-02-10 16:17:08 +02:00
Jukka Kurkela
ddfbcf777a
Update eslint-config-chartjs to v0.3.0 (#8406) 2021-02-10 08:21:39 -05:00
Jukka Kurkela
61aea761f4
Unify signature of plugin hooks (#8102) 2020-11-28 09:45:43 +02:00
Jukka Kurkela
4f2511aff3
Relocate dataset defaults to defaults.controllers (#7979) 2020-10-30 18:34:32 -04:00
Jukka Kurkela
6ad17c0294
Stop bundling specs for improved coverage (#7709) 2020-08-14 09:15:18 -04:00
Jukka Kurkela
39eb39008d
Rename platform/platform to index removing default (#7391)
Rename platform/platform to index removing default
2020-05-21 16:36:06 -04:00
Jukka Kurkela
cfb5fba527
Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment
2020-05-20 17:45:44 -04:00
Ben McCann
53205457dc
Add tests for rendering to offscreen canvas (#7175)
Add tests for using an offscreen canvas for Chart.js. These tests are
almost identical to existing tests, but with offscreen canvas enabled.

Co-authored-by: David Winegar <david.winegar@getcruise.com>
2020-03-06 12:17:12 -05:00
Jukka Kurkela
a1c2dd6fb6 Throttle all events (to 1 / frame each) (#6953)
* Throttle all events
* Asynchronize event tests
2020-01-14 07:34:08 -05:00
Jukka Kurkela
16b1fb11b4 waitForResize before resizing (#6954)
* waitForResize before resizing
* Change the failing test
* Change the other leaking test too
2020-01-13 19:35:44 -05:00
andig
8dca88c7d5 Fix tests on OSX with retina screen
* Fix retina unit test failures
* Honor config file formatting
* Prevent gulp error on non-zero karma result
2017-08-05 10:48:12 -04:00
Simon Brunel
c6bda02468 Rewrite unit test waitForResize helper (#4566)
The original implementation tries to intercept events from the chart internal iframe, which ones failing on Chrome 60. Checking internals doesn't seem the best approach, instead we could consider that a chart has been resized after the resize method has been called and processed. So let's hook `Chart.resize` and callback once it's done.
2017-07-26 13:33:45 +02:00
Simon Brunel
4c763bff44 Enforce spaces around infix/unary words operators (#4547)
Enable ESLint `space-infix-ops` and `space-unary-ops` (for words only) rules. Also added `samples` to the linting task to match Code Climate expectations.

http://eslint.org/docs/rules/space-infix-ops
http://eslint.org/docs/rules/space-unary-ops
2017-07-22 14:13:09 +02:00
Jerome Touffe-Blin
fa6be2f772 Fix inconsistent aspect ratio 2017-06-04 09:41:13 -04:00
Simon Brunel
f7d2d7536a Fix failing instanceof when reading context
`instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is inside an iframe or when running in a protected environment. We could guess the types from their toString() value but let's keep things flexible and assume it's a sufficient condition if the item has a context2D which has item as `canvas`.
2017-04-22 13:14:16 -04:00
Simon Brunel
bd60fa2dfd Correctly handle decimal display size (#4009)
Fix the `readUsedSize` regular expression to correctly parse (truncate) pixel decimal values.
2017-03-18 11:54:56 +01:00
Simon Brunel
c216c0af76 Cleanup and upgrade unit tests environment
`karma.conf.ci.js` has been merged into `karma.conf.js` for local testing consistency: `gulp unittestWatch` has been replaced by `gulp unittest --watch` and thus use exactly the same config file. Upgrade to latest jasmine and karma packages and remove deprecated `gulp-karma` dependency (directly use `karma.Server` in gulp).

Split `test/mockContext.js` into smaller `test/jasmine.*` modules to make easier unit tests maintenance and finally, move all `*.test.js` files under the `test/specs` folder.
2017-03-04 11:39:48 -05:00