Skip to content

Commit

Permalink
fix: reverse data correctly #1250
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Oct 4, 2022
1 parent 69389e8 commit 77e163b
Show file tree
Hide file tree
Showing 7 changed files with 490 additions and 409 deletions.
28 changes: 28 additions & 0 deletions src/charts/BarChart/BarChart.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,33 @@ describe('Charts', () => {
).toBeDefined();
});
});

it('should correct apply class names', async () => {
data = {
labels: ['A', 'B', 'C'],
series: [
{
className: 'series-1',
data: [1, 2, 3]
},
{
className: 'series-2',
data: [4, 5, 6]
}
]
};
options = {
reverseData: true
};
await createChart();

const seriesElements = document.querySelectorAll('.ct-series');

expect(seriesElements[0]).toHaveClass('series-2');
expect(seriesElements[0]).toContainHTML('ct:value="6"');

expect(seriesElements[1]).toHaveClass('series-1');
expect(seriesElements[1]).toContainHTML('ct:value="3"');
});
});
});
Loading

0 comments on commit 77e163b

Please sign in to comment.