11 lines
304 B
TypeScript
Raw Normal View History

2020-04-24 12:02:32 +02:00
import test from 'ava';
2020-04-24 17:01:26 +02:00
import { Edge, Color, EdgeStyles } from '../lib';
2020-04-24 12:02:32 +02:00
test ('serialize', (t) => {
const e = new Edge ('foo', 'bar');
2020-04-24 17:01:26 +02:00
e.color = Color.white;
e.style = EdgeStyles.dashed;
2020-04-24 12:02:32 +02:00
const serialized = e.toString ();
2020-04-24 17:01:26 +02:00
t.is (serialized, 'foo -> bar [style="dashed",color="#ffffff"]');
2020-04-24 12:02:32 +02:00
});