You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
569 B

var tape = require('tape');
var mjAPI = require("..//lib/mj-single.js");
var jsdom = require('jsdom').jsdom;
tape('the SVG width should match the default', function(t) {
t.plan(1);
mjAPI.start();
var tex = 'a \\\\ b';
var expected = '100ex';
mjAPI.typeset({
math: tex,
format: "TeX",
svg: true
}, function(data) {
var document = jsdom(data.svg);
var window = document.defaultView;
var element = window.document.getElementsByTagName("svg")[0];
var width = element.getAttribute('width');
t.equal(width, expected);
});
});