@robotical/martyblocksjr 4.2.12 → 4.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/martyblocksjr",
3
- "version": "4.2.12",
3
+ "version": "4.2.13",
4
4
  "description": "ScratchJr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,6 +46,7 @@ describe('micro:bit display artwork', () => {
46
46
  const svg = readFileSync(join(ASSET_DIRECTORY, 'categories', file), 'utf8');
47
47
 
48
48
  expect(svg).not.toContain('data-microbit-display="true"');
49
+ expect(svg).toContain('data-microbit-source="microbit-small"');
49
50
  expect(svg).toMatch(/#4c97ff/i);
50
51
  expect(svg).toMatch(/#ffbf00/i);
51
52
  });
@@ -61,4 +62,16 @@ describe('micro:bit display artwork', () => {
61
62
  expect(blockArg).not.toContain('drawMicroBitBoard');
62
63
  expect(editorCss).toMatch(/\.microbitMatrixCell\.on\s*\{[^}]*background:\s*#FFFFFF;/s);
63
64
  });
65
+
66
+ it('overlays the paintbrush artwork while retaining the editor arrow', () => {
67
+ const blockArg = readFileSync(join('src', 'editor', 'blocks', 'BlockArg.js'), 'utf8');
68
+ const blockSpecs = readFileSync(join('src', 'editor', 'blocks', 'BlockSpecs.js'), 'utf8');
69
+
70
+ expect(blockSpecs).toContain(
71
+ "BlockSpecs.paintbrush = BlockSpecs.getImageFrom('assets/paint/paintbrush', 'svg');"
72
+ );
73
+ expect(blockArg).toContain('this.button = this.addPressButton();');
74
+ expect(blockArg).toContain('this.drawMicroBitEditorIndicator(ctx, scale);');
75
+ expect(blockArg).toContain('ctx.drawImage(paintbrush, 38, 28, 30, 30);');
76
+ });
64
77
  });
@@ -369,10 +369,10 @@ describe("Chromium 79 smoke test", () => {
369
369
  50,
370
370
  50,
371
371
  ]]);
372
- block.arg.pressMicroBitMatrixEditor({
373
- preventDefault() {},
374
- stopPropagation() {},
375
- });
372
+ block.arg.button.dispatchEvent(new PointerEvent("pointerdown", {
373
+ bubbles: true,
374
+ cancelable: true,
375
+ }));
376
376
  const cells = Array.from(document.querySelectorAll(".microbitMatrixCell"));
377
377
  cells[12].dispatchEvent(new PointerEvent("pointerdown", { bubbles: true, cancelable: true }));
378
378
  return {