Skip to content

Commit

Permalink
fix: Test for minimap playground (#1875)
Browse files Browse the repository at this point in the history
* fixed test

* removed private
  • Loading branch information
cesarades authored Aug 23, 2023
1 parent b5f6f0b commit 19ca60e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion plugins/workspace-minimap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
"private": true,
"main": "./dist/index.js",
"module": "./src/index.js",
"unpkg": "./dist/index.js",
Expand Down
10 changes: 8 additions & 2 deletions plugins/workspace-minimap/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import * as Blockly from 'blockly';
import {toolboxCategories, createPlayground} from '@blockly/dev-tools';
import {Minimap, PositionedMinimap} from '../src/index';

let minimap = null;
let workspace = null;

/**
* Create a workspace.
* @param blocklyDiv The blockly container div.
Expand All @@ -21,8 +24,11 @@ import {Minimap, PositionedMinimap} from '../src/index';
function createWorkspace(blocklyDiv: HTMLElement,
options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg {
// Creates the primary workspace and adds the minimap.
const workspace = Blockly.inject(blocklyDiv, options);
const minimap = new PositionedMinimap(workspace);
if (minimap) {
minimap.dispose();
}
workspace = Blockly.inject(blocklyDiv, options);
minimap = new PositionedMinimap(workspace);
minimap.init();

return workspace;
Expand Down

0 comments on commit 19ca60e

Please sign in to comment.