diff --git a/src/playground/player.css b/src/playground/player.css index 355eeeecd49ccbaf5f29d8d06eebd676b31c2c57..a0a00f9aa288fdd4d88de5cb991af0d0183f4218 100644 --- a/src/playground/player.css +++ b/src/playground/player.css @@ -2,6 +2,14 @@ width: calc(480px + 1rem); } +.editor { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; +} + .stage-only * { box-sizing: border-box; } diff --git a/src/playground/player.jsx b/src/playground/player.jsx index 2235bbac703d01ebfe4003976a3ce65919b3eb95..8224ad6489c57ce5b071704de1adcdb776345b95 100644 --- a/src/playground/player.jsx +++ b/src/playground/player.jsx @@ -21,11 +21,7 @@ if (process.env.NODE_ENV === 'production' && typeof window === 'object') { import styles from './player.css'; const Player = ({isPlayerOnly, onSeeInside, projectId}) => ( - <Box - className={classNames({ - [styles.stageOnly]: isPlayerOnly - })} - > + <Box className={classNames(isPlayerOnly ? styles.stageOnly : styles.editor)}> {isPlayerOnly && <button onClick={onSeeInside}>{'See inside'}</button>} <GUI enableCommunity diff --git a/test/integration/blocks.test.js b/test/integration/blocks.test.js index d70396032cc5944054819f0482d018febc753d13..b2b048e4115b0271c70504d2b74deab67198b921 100644 --- a/test/integration/blocks.test.js +++ b/test/integration/blocks.test.js @@ -228,4 +228,21 @@ describe('Working with the blocks', () => { await driver.sleep(500); // Wait for scroll to finish await clickText('Meow', scope.blocksTab); // Meow, not A Bass }); + + // Regression test for switching between editor/player causing toolbox to stop updating + test('"See inside" after being on project page re-initializing variables', async () => { + const playerUri = path.resolve(__dirname, '../../build/player.html'); + await loadUri(playerUri); + await clickText('See inside'); + await clickText('Variables'); + await driver.sleep(500); // Wait for scroll to finish + await clickText('my\u00A0variable'); + + await clickText('See Project Page'); + await clickText('See inside'); + + await clickText('Variables'); + await driver.sleep(500); // Wait for scroll to finish + await clickText('my\u00A0variable'); + }); });