Skip to main content

One post tagged with "compatible with angular"

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?