diff --git a/CHANGELOG.md b/CHANGELOG.md index f111dbb58a2..73abd57bad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ ## [next] -- BREAKING: remove calculate true/false from the api. [#9483](https://github.com/fabricjs/fabric.js/pull/9483) +- test(FabricObject): add a snapshot of the default values so that reordering and shuffling is verified. [#9492](https://github.com/fabricjs/fabric.js/pull/9492) +- feat(FabricObject, Canvas) BREAKING: remove calculate true/false from the api. [#9483](https://github.com/fabricjs/fabric.js/pull/9483) - chore(): remove some Type assertions [#8950](https://github.com/fabricjs/fabric.js/pull/8950) - chore(): expose `sendVectorToPlane` [#9479](https://github.com/fabricjs/fabric.js/pull/9479) -- BREAKING: remove absolute true/false from the api. [#9395](https://github.com/fabricjs/fabric.js/pull/9395) +- feat(FabricObject, Canvas) BREAKING: remove absolute true/false from the api. [#9395](https://github.com/fabricjs/fabric.js/pull/9395) - refactor(Canvas): BREAKING deprecate `getPointer`, add new getScenePoint and getViewportPoint methods, removed `restorePointerVpt`, extended mouse events data [#9175](https://github.com/fabricjs/fabric.js/pull/9175) - chore(): rm isClick artifacts leftovers from #9434 [#9478](https://github.com/fabricjs/fabric.js/pull/9478) - fix(Object): Fix detection of falsy shadows in Object.needsItsOwnCache method [#9469](https://github.com/fabricjs/fabric.js/pull/9469) diff --git a/src/shapes/Object/InteractiveObject.spec.ts b/src/shapes/Object/InteractiveObject.spec.ts index 72bf246a582..3d17ce0d96e 100644 --- a/src/shapes/Object/InteractiveObject.spec.ts +++ b/src/shapes/Object/InteractiveObject.spec.ts @@ -4,7 +4,11 @@ import { Canvas } from '../../canvas/Canvas'; import { FabricObject } from './FabricObject'; import type { TOCoord } from './InteractiveObject'; -describe('Object', () => { +describe('FabricObject', () => { + it('Interactive + BaseObject default values', () => { + const { controls, ...defaults } = FabricObject.getDefaults(); + expect(defaults).toMatchSnapshot(); + }); describe('setCoords for objects inside group with rotation', () => { it('all corners are rotated as much as the object total angle', () => { const canvas = new Canvas(); diff --git a/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap b/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap new file mode 100644 index 00000000000..af89132f9bc --- /dev/null +++ b/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FabricObject Interactive + BaseObject default values 1`] = ` +{ + "FX_DURATION": 500, + "absolutePositioned": false, + "activeOn": "down", + "angle": 0, + "backgroundColor": "", + "borderColor": "rgb(178,204,255)", + "borderDashArray": null, + "borderOpacityWhenMoving": 0.4, + "borderScaleFactor": 1, + "centeredRotation": true, + "centeredScaling": false, + "clipPath": undefined, + "colorProperties": [ + "fill", + "stroke", + "backgroundColor", + ], + "cornerColor": "rgb(178,204,255)", + "cornerDashArray": null, + "cornerSize": 13, + "cornerStrokeColor": "", + "cornerStyle": "rect", + "dirty": true, + "evented": true, + "excludeFromExport": false, + "fill": "rgb(0,0,0)", + "fillRule": "nonzero", + "flipX": false, + "flipY": false, + "globalCompositeOperation": "source-over", + "hasBorders": true, + "hasControls": true, + "height": 0, + "hoverCursor": null, + "includeDefaultValues": true, + "inverted": false, + "left": 0, + "lockMovementX": false, + "lockMovementY": false, + "lockRotation": false, + "lockScalingFlip": false, + "lockScalingX": false, + "lockScalingY": false, + "lockSkewingX": false, + "lockSkewingY": false, + "minScaleLimit": 0, + "moveCursor": null, + "noScaleCache": true, + "objectCaching": true, + "opacity": 1, + "originX": "left", + "originY": "top", + "padding": 0, + "paintFirst": "fill", + "perPixelTargetFind": false, + "scaleX": 1, + "scaleY": 1, + "selectable": true, + "selectionBackgroundColor": "", + "shadow": null, + "skewX": 0, + "skewY": 0, + "stroke": null, + "strokeDashArray": null, + "strokeDashOffset": 0, + "strokeLineCap": "butt", + "strokeLineJoin": "miter", + "strokeMiterLimit": 4, + "strokeUniform": false, + "strokeWidth": 1, + "top": 0, + "touchCornerSize": 24, + "transparentCorners": true, + "visible": true, + "width": 0, +} +`;