/* * 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 , 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"]'); });