add tests to charts.js