From 0f803dfc41a7bb6dc3156307999a2e8308b23da0 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 15 Feb 2019 09:10:42 -0500 Subject: [PATCH] Request a toolbox refresh after switching between tabs to fix #4561 --- src/containers/blocks.jsx | 1 + test/integration/blocks.test.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index d548ccff8..ecb998ea4 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -162,6 +162,7 @@ class Blocks extends React.Component { this.setLocale(); } else { this.props.vm.refreshWorkspace(); + this.requestToolboxUpdate(); } window.dispatchEvent(new Event('resize')); diff --git a/test/integration/blocks.test.js b/test/integration/blocks.test.js index 938508111..e6c37b24a 100644 --- a/test/integration/blocks.test.js +++ b/test/integration/blocks.test.js @@ -252,4 +252,18 @@ describe('Working with the blocks', () => { await driver.sleep(500); // Wait for scroll to finish await clickText('my\u00A0variable'); }); + + // Regression test for switching editor tabs causing toolbox to stop updating + test('Creating variables after adding extensions updates the toolbox', async () => { + await loadUri(uri); + await clickText('Costumes'); + await clickText('Code'); + await clickText('Variables', scope.blocksTab); + await driver.sleep(500); // Wait for scroll + await clickText('Make a List'); + const el = await findByXpath("//input[@name='New list name:']"); + await el.sendKeys('list1'); + await clickButton('OK'); + await clickText('list1', scope.blocksTab); + }); });