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

fix(format): error when expect(elem).not.toBeAccessible is called on an elem with no a11y issues #18

Closed
mohanraj-r opened this issue Jun 5, 2020 · 0 comments · Fixed by #21
Assignees
Labels
bug Something isn't working P3 Priority: Low

Comments

@mohanraj-r
Copy link
Contributor

For a HTML element that has no a11y issues:
Expected: expect(elem).not.toBeAccessible() to throw a jest exception error
Got:

  TypeError: Cannot read property 'format' of undefined

      at message (../node_modules/@sa11y/jest/dist/matcher.js:57:137)
      at getMessage (../node_modules/expect/build/index.js:177:15)
      at processResult (../node_modules/expect/build/index.js:295:25)
      at asyncResult.then.aResult (../node_modules/expect/build/index.js:353:28)

This should not be a critical issues as the not matcher is not expected to be used with the toBeAccessible matcher in primary workflows.

@mohanraj-r mohanraj-r added the bug Something isn't working label Jun 5, 2020
@mohanraj-r mohanraj-r self-assigned this Jun 5, 2020
@mohanraj-r mohanraj-r added the P3 Priority: Low label Jun 5, 2020
@mohanraj-r mohanraj-r changed the title error when expect(elem).not.toBeAccessible is called on an elem with no a11y issues fix(format): error when expect(elem).not.toBeAccessible is called on an elem with no a11y issues Jun 22, 2020
@mohanraj-r mohanraj-r linked a pull request Jun 25, 2020 that will close this issue
8 tasks
mohanraj-r pushed a commit that referenced this issue Jul 28, 2020
* BREAKING CHANGE: refactor(preset-rules): rename extended ruleset to recommended to align the name of the ruleset with the default recommended behavior
* BREAKING CHANGE: refactor(preset-rules): rename recommended preset rule to base so that the recommended ruleset can be the default and "recommended”; also follow common naming conventions in terms of preset configs
* feat(preset-rules): add a full ruleset with all rules from axe
* feat(wdio): add a sync version of the assert accessible api
* feat(wdio): add assert accessible API for WDIO
* fix(format): check explicitly for undefined to allow custom formatter
* fix(format): fix a11y error message to use formatted output
* fix(jest): handle a11y error being undefined when used with not matcher Fixes #18
* refactor(test-utils): de-duplicate test html data between wdio and test-utils
* refactor(wdio): extract common code out of assert, wdio
* refactor(wdio): extract common test workflow into a test util method
* refactor(wdio): replace executeAsync with execute in get axe version
* test(cspell): add flagwords based on recommendations from https://tools.ietf.org/id/draft-knodel-terminology-00.html
* test(integ): add integ test to inject axe using wdio
* test(jest): add matcher test for non a11y error scenario
* test(wdio): add tests to inject axe using wdio
* test(wdio): add tests using the wdio assert API
* version: add a auto version sub-command
* build: add run script to do a clean build and run checks, tests
* build: move lint staged config to its own file
* build: remove semantic release
* build: replace monorepo root package name as “root” already exists in npm which results in incorrect info on “npm info”
* build: replace ncu with yarn upgrade interactive
* build: update axe-core to 3.5.5
* build(release): modify changelog, version commands
* build(release): remove obsolete lerna config as we are not tagging, committing automatically
* build(wdio,jest): fix peer dependencies to use >= to allow for broader version match
* build(wdio): add build step to post checkout git hook
* build(wdio): add test watch script, config for wdio tests
* build(wdio): move wdio dev deps out of wdio package to root level so that it can be consistent across different packages in the repo that use wdio
* changelog - include unreleased changes, move under "release:"
* chore: add version to root package json to be used in github releases
* ci(circleci): add chrome browser and chrome driver to ci env
* ci(github): add codeowners file
* docs: add changelog for latest changes
* docs: fix all Readme headings and structure for consistency
* docs(contrib): add note about yarn installing when changing branches
* docs(jest): add clarification on recommended ruleset
* inject axe only if its already not present
* move common exception processing into a11y error
* pin axe-core dependency in the update process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Priority: Low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant