Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

[terra-functional-testing] Remove axe option from the Terra Service #466

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

StephenEsser
Copy link
Contributor

@StephenEsser StephenEsser commented Nov 4, 2020

Summary

This PR removes the axe override from the Terra Service configuration options. These rules are now set explicitly by the service.

Resolves #463

Additional Details

To remove the axe option a theme option was required to properly configure the axe rules based on the current theme. The theme is currently used for the lowlight theme to adjust the color contrast rules.

https://github.com/cerner/terra-toolkit-boneyard/blob/main/config/wdio/wdio.conf.js#L100-L102

@cerner/terra

@mjhenkes mjhenkes temporarily deployed to terra-toolki-remove-axe-p2arnq November 4, 2020 00:54 Inactive
Comment on lines +19 to +21
const globalRuleArray = Object.keys(Terra.axe.rules).map((rule) => (
{ ...Terra.axe.rules[rule], id: rule }
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const globalRuleArray = Object.keys(Terra.axe.rules).map((rule) => (
{ ...Terra.axe.rules[rule], id: rule }
));
const globalRuleArray = Object.entries(Terra.axe.rules).map((rule, settings) => (
{ ...settings, id: rule }
));

const { formFactor, theme } = options;

this.formFactor = formFactor;
this.theme = theme || 'terra-default-theme';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #464 I'm exposing the entire service options object thru Terra.serviceOptions. I should probably default Terra.serviceOptions.theme to terrra-default-theme to keep them in sync. Would it be better to default the theme to terrra-default-theme in wdio.config.js or are we concerned that this config may get overridden by consumers.

Copy link
Contributor Author

@StephenEsser StephenEsser Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the TerraService should default the option if it needs a default rather than requiring a theme be set in the wdio.config

@mjhenkes mjhenkes temporarily deployed to terra-toolki-remove-axe-p2arnq November 4, 2020 16:28 Inactive
@StephenEsser StephenEsser merged commit ac1645d into main Nov 5, 2020
@StephenEsser StephenEsser deleted the remove-axe-config branch November 5, 2020 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[terra-functional-testing] Investigate removing the axe option from the terra service
5 participants