diff --git a/src/components/blockly/PBBlocklyWorkspace.tsx b/src/components/blockly/PBBlocklyWorkspace.tsx index fde65091..d5f95fb0 100644 --- a/src/components/blockly/PBBlocklyWorkspace.tsx +++ b/src/components/blockly/PBBlocklyWorkspace.tsx @@ -38,7 +38,7 @@ export const PBBlocklyWorkspace = ({ blockIds, categorized, sx, title, ...props return ( {title && {t('preview')}} - + ) } diff --git a/src/components/blockly/blockly.ts b/src/components/blockly/blockly.ts index 87c922ea..250b0b7d 100644 --- a/src/components/blockly/blockly.ts +++ b/src/components/blockly/blockly.ts @@ -1483,5 +1483,6 @@ export const setXml = (xml: string ) => { export const setupBlockly = (container: Element, workspaceConfiguration: Blockly.BlocklyOptions) => { container.replaceChildren() //Removes previous injection, otherwise it might keep inserting below the current workspace + container.ariaValueText = 'child-blockly' Blockly.inject(container, workspaceConfiguration) } \ No newline at end of file diff --git a/src/test/Creator/ToolboxPreview.test.tsx b/src/test/Creator/ToolboxPreview.test.tsx index 6f0621dd..578b32dd 100644 --- a/src/test/Creator/ToolboxPreview.test.tsx +++ b/src/test/Creator/ToolboxPreview.test.tsx @@ -4,14 +4,12 @@ import { ToolboxPreview } from '../../components/creator/Editor/ChallengeDetails import { commonBlocks, sceneBlocks } from '../../components/blockly/blocks'; describe('Toolbox Preview', () => { - test.skip('rendering toolbox preview ', async () => { + test('rendering toolbox preview ', async () => { + const toolBoxItems = [...commonBlocks.map((block => block.id)), ...sceneBlocks.map((block => block.id))] + renderComponent(); + const idPBBlockly = await screen.findByTestId('pb-blockly') + expect(idPBBlockly).toBeInTheDocument() + expect(idPBBlockly.firstChild).toHaveClass('injectionDiv') + }); - const toolBoxItems = [...commonBlocks.map((block => block.id)), ...sceneBlocks.map((block => block.id))] - - renderComponent() - - const blocks = await screen.findByTestId(toolBoxItems.join(",")) - - expect(blocks).toBeInTheDocument() - }) })