8000 Cursor tests fail because focus manager is not reset correctly · Issue #8954 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cursor tests fail because focus manager is not reset correctly #8954
Closed
@rachel-fenichel

Description

@rachel-fenichel

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

The tests in cursor_test.js, in the Movement suite, fail with traces like this:

‣
Error: No highlight SVG found corresponding to this connection.
    at RenderedConnection.getFocusableElement (file:///usr/local/google/home/bhenning/opensource/blockly/build/src/core/rendered_connection.js:556:15)
    at FocusManager.focusNode (file:///usr/local/google/home/bhenning/opensource/blockly/build/src/core/focus_manager.js:198:87)
    at LineCursor.setCurNode (file:///usr/local/google/home/bhenning/opensource/blockly/build/src/core/keyboard_nav/line_cursor.js:475:31)
    at Context.<anonymous> (cursor_test.js:129:19)

In most cases, the root cause is that the focus manager state is not correctly cleared during teardown between tests. The focus manager still holds a location and attempts to set passive focus on it, but fails because there is no corresponding svg element to update.

The issue can be resolved by adding a reset function in focus manager and using it during teardown:
export function resetFocusManager() { focusManager = null;

This implies an actual issue with focus manager cleanup that @BenHenning will investigate.

Reproduction steps

Stack trace

Screenshots

No response

Browsers

No response

Metadata

Metadata

Assignees

Labels

issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0