UNPKG

cxviz-rawtree

Version:

Raw Tree Visualization

48 lines (38 loc) 1.08 kB
'use strict'; var test = require('tape') var jsdom = require('jsdom') var data = require('strong-trace-waterfalldata') var xform = require('strong-trace-waterfalltransform') var sample1 = xform.enhanceWaterfall(data.expressExample) var RawTree = require('../') jsdom.env( '<body></body>', ['http://code.jquery.com/jquery.js'], function (errors, window) { var $ = window.$ var el = window.document.createElement('div') var graph = new RawTree() graph.init(el) var waterfall = sample1.waterfalls[5] graph.update(waterfall) test('log el html', function (t) { // console.log(waterfall.costTree); console.log(el.innerHTML); t.end() }) test('returns el', function (t) { t.equal(el, graph.el) t.end() }) test('attaches svg', function (t) { var $svg = $(graph.el).find('svg') t.ok($svg.length > 0) t.end() }) test('creates initial .cost rect', function (t) { var $cost = $(graph.el).find('g.cxviz-raw-item') t.ok($cost.length > 0) t.end() }) } )