2020-05-17 17:17:39 +02:00

30 lines
764 B
TypeScript

/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of graphviz-builder which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
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"]');
});