/
githubmirror
/
Chart.js
Обзор
Документация
Войти
/
githubmirror
/
Chart.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/specs/mixed.tests.js
46 строк
1 KB
t-mangoe
check the data set type in DoughnutController (#10867)
12 ноя 2022, 23:41
Не верифицирован
12 ноя 2022, 23:41
63993b0
Код
Авторство
О чём код?
describe('Mixed charts', function() { describe('auto', jasmine.fixture.specs('mixed')); it('shoud be constructed with doughnuts chart', function() { const chart = window.acquireChart({ data: { datasets: [{ type: 'line', data: [10, 20, 30, 40], }, { type: 'doughnut', data: [10, 20, 30, 50], } ], labels: [] } }); const meta0 = chart.getDatasetMeta(0); expect(meta0.type).toEqual('line'); const meta1 = chart.getDatasetMeta(1); expect(meta1.type).toEqual('doughnut'); }); it('shoud be constructed with pie chart', function() { const chart = window.acquireChart({ data: { datasets: [{ type: 'bar', data: [10, 20, 30, 40], }, { type: 'pie', data: [10, 20, 30, 50], } ], labels: [] } }); const meta0 = chart.getDatasetMeta(0); expect(meta0.type).toEqual('bar'); const meta1 = chart.getDatasetMeta(1); expect(meta1.type).toEqual('pie'); }); });