/* * 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 { Edge, Color } from '../../lib'; describe ('edge', () => { it ('should serialize', () => { const e = new Edge ('foo', 'bar', false); e.color = Color.white; e.style = 'dashed'; const serialized = e.toString (); expect (serialized) .toEqual ('foo -- bar [style="dashed",color="#ffffff"]'); }); it ('should serialize directional', () => { const e = new Edge ('foo', 'bar', true); e.color = Color.white; e.style = 'dashed'; const serialized = e.toString (); expect (serialized) .toEqual ('foo -> bar [style="dashed",color="#ffffff"]'); }); });