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(tests): revert change in marker_svg to keep keyboard nav tests working #6457

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

rachel-fenichel
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Resolves one of the issues blocking google/blockly-samples#1297 (comment)

Proposed Changes

Use a cast and checking for a property, rather than an instanceof check, to make it safe to call beginElement() on a marker. This avoids breaking tests when run in jsdom.

Behavior Before Change

Tests broke becuase SVGAnimationElement was not defined when running with jsdom.

Behavior After Change

These tests pass (although a different set of tests fails >.<)

Reason for Changes

The tests are running in Mocha, and using jsdom to pretend that they are in a rendered page. The marker SVG and similar elements are created but certain classes don't exist. SVGAnimationElement is one of them, which triggered a failure.

Note that the tests running rendered in jsdom is a bit weird, but they cannot run in headless mode because keyboard navigation is not built for non-rendered workspaces.

Test Coverage

I built, packaged, and linked changes so that I could run keyboard navigation tests. The tests no longer fail on SVGAnimationElement, although two tests still fail.

Documentation

Additional Information

Once this change is in Beka will cut a beta so that we can test it over on samples and move the blocky-9-beta branch one step closer to working.

@rachel-fenichel rachel-fenichel requested a review from a team as a code owner September 29, 2022 23:38
@rachel-fenichel rachel-fenichel requested review from gonfunko and BeksOmega and removed request for gonfunko September 29, 2022 23:38
@rachel-fenichel rachel-fenichel added this to the 2022_q3_release milestone Sep 29, 2022
@BeksOmega BeksOmega merged commit dd0d0f6 into google:develop Sep 30, 2022
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.

3 participants