Skip to content

chore: Fix tests broken by plugin ESM updates - #10693

Open
lizschwab wants to merge 1 commit into
RaspberryPiFoundation:plugin-esmfrom
lizschwab:plugins-esm-fix-tests
Open

lizschwab wants to merge 1 commit into
RaspberryPiFoundation:plugin-esmfrom
lizschwab:plugins-esm-fix-tests

Conversation

@lizschwab

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes the tests which were broken when plugins that are imported into the test framework were updated to ESM.

Proposed Changes

  • Added a new test helper that bundles the @blockly/block-test and uses the global blockly instead of using its own copy of blockly
  • Updated node tests to use the new helper
  • Updated toolbox drag tests to use the new helper
  • Fixed some unrelated instability in browser tests

Reason for Changes

Updating plugins to ESM broke some of our tests. This resolves those issues.

Additional Information

AI was used to troubleshoot the problem with the tests and to draft the fix. I tested the changes, reviewed the code, and wrote the summary.

@lizschwab
lizschwab requested a review from a team as a code owner November 17, 2026 22:02
@lizschwab
lizschwab requested review from mikeharv and removed request for a team November 17, 2026 22:02
@github-actions github-actions Bot added the PR: chore General chores (dependencies, typos, etc) label Nov 17, 2026
const puppeteer = await driver.getPuppeteer();
const [page] = await puppeteer.pages();
const session = await page.createCDPSession();
await session.send('Emulation.setFocusEmulationEnabled', {enabled: true});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While testing the browser tests to ensure my changes worked, I kept getting failures on focus manager tests. This addresses that by stubbing out the window's focus state, making it so the tests no longer fail if the chrome window is not currently focused.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants