Skip to content

Commit 1f5d169

Browse files
authored
fix: Re-enable shadow block converter test (#2529)
## The basics - [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/samples#making_and_verifying_a_change) ## The details ### Resolves Fixes #2525 ### Proposed Changes This re-enables the shadow block converter test disabled in #2524. ### Reason for Changes It's preferable to not keep tests disabled as it's easy to forget about them (and having them disabled increases the risk of discovering regressions being delayed or never noticed). This particular fix is discussed in #2528. It's a bit complicated exactly how the global namespace is managed via `jsdom-global`, but essentially `SVGElement` (made available to Node.js via `jsdom`) is not being automatically bound to the global namespace and this works around the issue. ### Test Coverage N/A -- This is a test-only change. ### Documentation No documentation changes are needed. ### Additional Information This is a slightly ugly workaround, but it seems viable for the medium-term while #2528 is considered.
1 parent 29b5a0d commit 1f5d169

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugins/shadow-block-converter/test/shadow_block_converter_test.mocha.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {shadowBlockConversionChangeListener} = require('../src/index');
1111

1212
const assert = chai.assert;
1313

14-
suite.skip('shadowBlockConversionChangeListener', function () {
14+
suite('shadowBlockConversionChangeListener', function () {
1515
/**
1616
* Create a parent block with an unconnected value connection.
1717
* @param {Blockly.Workspace} workspace The workspace to use.
@@ -38,6 +38,8 @@ suite.skip('shadowBlockConversionChangeListener', function () {
3838
'<!DOCTYPE html><div id="blocklyDiv"></div>',
3939
{pretendToBeVisual: true},
4040
);
41+
// See https://github.com/google/blockly-samples/issues/2528 for context.
42+
global.SVGElement = window.SVGElement;
4143

4244
this.workspace = Blockly.inject('blocklyDiv');
4345
this.workspace.addChangeListener(shadowBlockConversionChangeListener);

0 commit comments

Comments
 (0)