diff --git a/__tests__/classes/CanvasRenderingContext2D.__getClippingPath.js b/__tests__/classes/CanvasRenderingContext2D.__getClippingPath.js index 130b1da..95388aa 100644 --- a/__tests__/classes/CanvasRenderingContext2D.__getClippingPath.js +++ b/__tests__/classes/CanvasRenderingContext2D.__getClippingPath.js @@ -52,18 +52,9 @@ describe('__getClippingRegion', () => { expect(region).toStrictEqual(ctx.__getClippingRegion()); }); - it('should restore the clipping region correctly when restored', () => { - const region = ctx.__getClippingRegion(); - ctx.save(); + it('should delete current clipping region when restored', () => { ctx.rect(1, 2, 3, 4); - ctx.arc(1, 2, 3, 4, 5); ctx.clip(); - expect(region).not.toStrictEqual(ctx.__getClippingRegion()); - ctx.restore(); - expect(region).toStrictEqual(ctx.__getClippingRegion()); - }); - - it('should delete current clipping region when restored', () => { ctx.save(); ctx.rect(1, 2, 3, 4); ctx.arc(1, 2, 3, 4, 5); diff --git a/__tests__/classes/__snapshots__/CanvasRenderingContext2D.__getClippingPath.js.snap b/__tests__/classes/__snapshots__/CanvasRenderingContext2D.__getClippingPath.js.snap index df64565..bc02a2d 100644 --- a/__tests__/classes/__snapshots__/CanvasRenderingContext2D.__getClippingPath.js.snap +++ b/__tests__/classes/__snapshots__/CanvasRenderingContext2D.__getClippingPath.js.snap @@ -2,9 +2,27 @@ exports[`__getClippingRegion should be empty when there are no path elements 1`] = `Array []`; -exports[`__getClippingRegion should delete current clipping region when restored 1`] = `Array []`; - -exports[`__getClippingRegion should restore the clipping region correctly when restored 1`] = `Array []`; +exports[`__getClippingRegion should delete current clipping region when restored 1`] = ` +Array [ + Object { + "props": Object { + "height": 4, + "width": 3, + "x": 1, + "y": 2, + }, + "transform": Array [ + 1, + 0, + 0, + 1, + 0, + 0, + ], + "type": "rect", + }, +] +`; exports[`__getClippingRegion should save the clipping region correctly when saved 1`] = ` Array [