Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(FabricObject): add a snapshot of the default values so that reordering and shuffling is verified. #9492

Merged
merged 3 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/shapes/Object/InteractiveObject.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
81 changes: 81 additions & 0 deletions src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -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,
}
`;
Loading