Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jan 9, 2022
1 parent fecdc01 commit 076a5f9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cypress/integration/layout.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
describe('Graph layout', () => {
it('layout should not fail with self transitions on machine node', () => {
// Plant a fake entry in localStorage
cy.setLocalStorage(
'xstate_viz_raw_source|no_source',
JSON.stringify({
date: new Date(),
sourceRawContent: `
import { createMachine } from 'xstate';
const machine = createMachine({
on: {
// These will now display as expected
LOAD: {},
UPDATE: {},
},
states: {
something: {},
},
});
`,
}),
);

cy.visit('/viz');

// Will time out if visualization fails
cy.getCanvas();
});
});

0 comments on commit 076a5f9

Please sign in to comment.