Skip to content

Commit 36cf0ab

Browse files
committed
(fix/test): reset clearOnResize to true for size tests
- when false, canvas won't resize on window resize necessarily - was set false in previous test - this was found when branch coverage was lacking a bit on resizing, now we're at ~93% and missing just one branch! - the tests didn't error out though because without input size the canvas size is 0 in these tests regardless of resize - not a perfect test in that sense :/ :/
1 parent 3bd83ac commit 36cf0ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ describe('canvas resizing', () => {
161161

162162
const size = { width: 100, height: 100 }
163163
it('should not change size if fixed width & height', () => {
164-
wrapper.setProps({ canvasProps: size })
164+
// reset clearOnResize back to true after previous test
165+
wrapper.setProps({ clearOnResize: true, canvasProps: size })
165166
window.resizeTo(500, 500)
166167

167168
expect(canvas.width).toBe(size.width)

0 commit comments

Comments
 (0)