Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable accessibility module #471

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ember-highcharts/src/components/high-charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ export default class HighCharts extends Component<HighChartsSignature> {
Highcharts = await import('highcharts');
}

const Accessibility = await import('highcharts/modules/accessibility');
Accessibility.default(Highcharts);

// 3d support
if (this.args.chartOptions?.chart?.options3d) {
const Boost = await import('highcharts/modules/boost');
Expand Down
18 changes: 18 additions & 0 deletions test-app/tests/integration/components/high-charts-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module('Integration | Component | High Charts', function (hooks) {
<HighCharts />
`);

await waitFor('.highcharts-credits');

// custom highcharts-configs/application.js is auto-loaded from tests/dummy/app
assert
.dom('.highcharts-credits')
Expand All @@ -41,6 +43,8 @@ module('Integration | Component | High Charts', function (hooks) {
/>
`);

await waitFor('.highcharts-legend');

assert
.dom('.highcharts-legend .highcharts-legend-item text')
.exists({ count: 1 }, 'expected one series');
Expand All @@ -52,13 +56,16 @@ module('Integration | Component | High Charts', function (hooks) {
test('should add a series', async function (assert) {
this.cityData = cityData;
this.lineChartOptions = lineChartOptions;

await render(hbs`
<HighCharts
@content={{this.cityData}}
@chartOptions={{this.lineChartOptions}}
/>
`);

await waitFor('.highcharts-legend');

assert
.dom('.highcharts-legend .highcharts-legend-item')
.exists({ count: 3 }, 'base series count');
Expand All @@ -83,13 +90,16 @@ module('Integration | Component | High Charts', function (hooks) {
test('should remove a series', async function (assert) {
this.cityData = cityData;
this.lineChartOptions = lineChartOptions;

await render(hbs`
<HighCharts
@content={{this.cityData}}
@chartOptions={{this.lineChartOptions}}
/>
`);

await waitFor('.highcharts-legend');

assert
.dom('.highcharts-legend .highcharts-legend-item')
.exists({ count: 3 }, 'base series count');
Expand Down Expand Up @@ -175,27 +185,35 @@ module('Integration | Component | High Charts', function (hooks) {
await render(hbs`
<HighCharts />
`);
await waitFor('.highcharts-container');

assert
.dom('.highcharts-container')
.exists({ count: 1 }, 'we rendered a chart without a mode specified');

await render(hbs`
<HighCharts @mode="" />
`);
await waitFor('.highcharts-container');

assert
.dom('.highcharts-container')
.exists({ count: 1 }, 'we rendered a chart with empty string mode');

await render(hbs`
<HighCharts @mode={{false}}/>
`);
await waitFor('.highcharts-container');

assert
.dom('.highcharts-container')
.exists({ count: 1 }, 'we rendered a chart with false boolean mode');

await render(hbs`
<HighCharts @mode={{null}}/>
`);
await waitFor('.highcharts-container');

assert
.dom('.highcharts-container')
.exists({ count: 1 }, 'we rendered a chart with null mode');
Expand Down