23 lines
533 B
TypeScript
23 lines
533 B
TypeScript
import test from 'ava';
|
|
import { Edge, Color } from '../lib';
|
|
|
|
test ('serialize', (t) => {
|
|
const e = new Edge ('foo', 'bar', false);
|
|
|
|
e.color = Color.white;
|
|
e.style = 'dashed';
|
|
const serialized = e.toString ();
|
|
|
|
t.is (serialized, 'foo -- bar [style="dashed",color="#ffffff"]');
|
|
});
|
|
|
|
test ('serialize directional', (t) => {
|
|
const e = new Edge ('foo', 'bar', true);
|
|
|
|
e.color = Color.white;
|
|
e.style = 'dashed';
|
|
const serialized = e.toString ();
|
|
|
|
t.is (serialized, 'foo -> bar [style="dashed",color="#ffffff"]');
|
|
});
|