Commit Graph

2 Commits (7544da2da3aaa9488da03059fb76c24637ad485a)

Author SHA1 Message Date
Thomas Bouffard ffd5036054
fix(robustness): prevent errors when a plugin is not loaded (#272)
Add guards to prevent accessing properties and methods on undefined
instances when a plugin is not loaded.
Also fix and improve the JSDoc of the `EdgeHandler` and `Guide` classes.
2023-12-07 16:10:33 +01:00
Thomas Bouffard b7a322b36f
fix: CellOverlay constructor use all parameters to set properties (#159)
The `align` and `verticalAlign` values passed to the constructor weren't
set, so the overlay position was always set to
the default one.

The `align` and `verticalAlign` properties are now using the AlignValue
and VAlignValue types respectively instead of
defining inline types. This improves the consistent in the whole code.

To demonstrate the fix, the Overlays story now set 'align' and
'verticalAlign' randomly.


Also introduce `jest` to test the fix and the whole
implementation of the changed method. Types check support is provided by
`ts-jest`. As maxGraph uses a lot of browser objects, also setup
`jest-jsdom-environment`.
2022-12-16 16:51:51 +01:00