Skip to main content

2 posts tagged with "jsplumb"

View All Tags

Unit Testing with JsPlumb

· 10 min read
Simon Porritt
JsPlumb core team

At the time of writing, JsPlumb has a test suite consisting of almost 11 000 unit tests, covering every aspect of the library including its integrations with Angular, React, Vue and Svelte. We like having this many unit tests: it gives us confidence both in the quality of the library and in making updates. When we develop new features we first add a bunch of tests that break and then we update the code until our new tests - and all of the tests we had previously - work.

How do you test a UI built with JsPlumb, though? What are the sorts of things you might like to test? A non-exhaustive list:

  • Are my nodes/groups being rendered the way I expect?
  • Can users drag edges in the way I expect them to be able to?
  • Is node dragging behaving the way I expect?
  • Can users edit nodes with an inspector?
  • Are events firing in the way I expect?
  • Is the integrity of my dataset ok?

Angular signals integration

· 8 min read
Simon Porritt
JsPlumb core team

Angular's new(ish) Signals system is a great addition to their library, and one which we're keeping an eye on with a view to updating JsPlumb's Angular integration to help you make the best use of it.

Signals were introduced in Angular 16 and have been improved upon in Angular 17. We know that upgrading Angular versions is not something people take lightly, so for the time being we are focusing on what Angular 16 offers, and we'll be looking at ways of releasing support in JsPlumb.

Right now, though - if you're already using Angular 16 or 17 - we thought you might like to see how you can take advantage of signals with the current version of JsPlumb.