diff --git a/__tests__/snapshot/board/examples/test/scroll.html.jpg b/__tests__/snapshot/board/examples/test/scroll.html.jpg index 7b66ff7..2f4e6ef 100644 Binary files a/__tests__/snapshot/board/examples/test/scroll.html.jpg and b/__tests__/snapshot/board/examples/test/scroll.html.jpg differ diff --git a/__tests__/snapshot/board/examples/test/transform-large.html.jpg b/__tests__/snapshot/board/examples/test/transform-large.html.jpg deleted file mode 100644 index 37aa913..0000000 Binary files a/__tests__/snapshot/board/examples/test/transform-large.html.jpg and /dev/null differ diff --git a/__tests__/snapshot/board/examples/test/transform-small.html.jpg b/__tests__/snapshot/board/examples/test/transform-small.html.jpg deleted file mode 100644 index ce4a643..0000000 Binary files a/__tests__/snapshot/board/examples/test/transform-small.html.jpg and /dev/null differ diff --git a/__tests__/snapshot/core/examples/test/update-element.html.jpg b/__tests__/snapshot/core/examples/test/update-element.html.jpg index 01b7370..d035ae8 100644 Binary files a/__tests__/snapshot/core/examples/test/update-element.html.jpg and b/__tests__/snapshot/core/examples/test/update-element.html.jpg differ diff --git a/__tests__/util/browser.js b/__tests__/util/browser.js deleted file mode 100644 index be6ff33..0000000 --- a/__tests__/util/browser.js +++ /dev/null @@ -1,22 +0,0 @@ -function mouseDown(x,y){ - const event = new MouseEvent('mousedown', { - screenX: x, - screenY: y, - clientX: x, - clientY: y, - }); - const elem = document.elementFromPoint(x,y); - elem.dispatchEvent(event); -} - - -function mouseUp(x,y){ - const event = new MouseEvent('mouseup', { - screenX: x, - screenY: y, - clientX: x, - clientY: y, - }); - const elem = document.elementFromPoint(x,y); - elem.dispatchEvent(event); -} diff --git a/packages/board/examples/test/scroll.html b/packages/board/examples/test/scroll.html index d2bb0c5..17b7e1a 100644 --- a/packages/board/examples/test/scroll.html +++ b/packages/board/examples/test/scroll.html @@ -4,12 +4,9 @@ -
+
+
+
+
+ + \ No newline at end of file diff --git a/packages/board/examples/test/transform-large.html b/packages/board/examples/test/transform-large.html deleted file mode 100644 index 2c465f7..0000000 --- a/packages/board/examples/test/transform-large.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/packages/board/examples/test/transform-small.html b/packages/board/examples/test/transform-small.html deleted file mode 100644 index 6250918..0000000 --- a/packages/board/examples/test/transform-small.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/scripts/browser/event.js b/scripts/browser/event.js new file mode 100644 index 0000000..4700fdd --- /dev/null +++ b/scripts/browser/event.js @@ -0,0 +1,52 @@ +function mouseDown(x,y){ + const event = new MouseEvent('mousedown', { + screenX: x, + screenY: y, + clientX: x, + clientY: y, + }); + const elem = document.elementFromPoint(x,y); + elem.dispatchEvent(event); +} + +function mouseUp(x,y){ + const event = new MouseEvent('mouseup', { + screenX: x, + screenY: y, + clientX: x, + clientY: y, + }); + const elem = document.elementFromPoint(x,y); + elem.dispatchEvent(event); +} + + +function wheelX(x, opts = { clientX: 0, clientY: 0 }){ + const event = new WheelEvent('wheel', { + deltaX: x, + deltaY: 0, + clientX: opts.clientX || 0, + clientY: opts.clientY || 0 + }); + const elem = document.elementFromPoint(opts.clientX, opts.clientY); + elem.dispatchEvent(event); +} + +function wheelY(y, opts = { clientX: 0, clientY: 0 }){ + const event = new WheelEvent('wheel', { + deltaX: 0, + deltaY: y, + clientX: opts.clientX || 0, + clientY: opts.clientY || 0 + }); + const elem = document.elementFromPoint(opts.clientX, opts.clientY); + elem.dispatchEvent(event); +} + + +export default { + mouseDown, + mouseUp, + wheelX, + wheelY, +} \ No newline at end of file diff --git a/scripts/screen.config.js b/scripts/screen.config.js index 4d5e6e0..4c68425 100644 --- a/scripts/screen.config.js +++ b/scripts/screen.config.js @@ -1,9 +1,7 @@ const pageList = [ { path: 'board/examples/test/main.html', w: 600, h: 400, delay: 500 }, - { path: 'board/examples/test/transform-small.html', w: 600, h: 400, delay: 500 }, - { path: 'board/examples/test/transform-large.html', w: 600, h: 400, delay: 500 }, { path: 'board/examples/test/scale.html', w: 920, h: 420, delay: 500 }, - { path: 'board/examples/test/scroll.html', w: 700, h: 500, delay: 500 }, + { path: 'board/examples/test/scroll.html', w: 620, h: 210, delay: 500 }, { path: 'board/examples/test/reset-size.html', w: 400, h: 300, delay: 500 }, { path: 'core/examples/test/rect.html', w: 600, h: 400, delay: 500 }, { path: 'core/examples/test/circle.html', w: 600, h: 400, delay: 500 },