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

Axe context #98

Merged
merged 3 commits into from
Jul 25, 2024
Merged

Axe context #98

merged 3 commits into from
Jul 25, 2024

Conversation

ahuth
Copy link
Contributor

@ahuth ahuth commented Jul 25, 2024

Add a parameter for Axe context. #53

Useful for excluding parts of the page.

@ahuth ahuth requested a review from a team July 25, 2024 12:26
* @see https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter
*/
get context() {
return this.parameters.context;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is checked elsewhere, but is .parameters guaranteed to exist here? (assuming typescript would be complaining if not)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's initialized in this object's constructor

Comment on lines +47 to +49
context: normalizeContext(rawStory.parameters?.axe?.context, rawStory) as
| Context
| undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note the as. I didn't feel like creating a Zod schema for all the permutations the context object can take, so left it just checking the general shape.

@ahuth
Copy link
Contributor Author

ahuth commented Jul 25, 2024

Thanks 🙏

@ahuth ahuth merged commit 3243d2b into main Jul 25, 2024
4 checks passed
@ahuth ahuth deleted the ah-context branch July 25, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants