UNPKG

@antv/x6

Version:

JavaScript diagramming library that uses SVG and HTML for rendering.

14 lines (12 loc) 421 B
import { Unit } from './index' describe('Unit', () => { describe('#toPx', () => { it('should return correct px', () => { expect(Math.floor(Unit.toPx(10, 'mm'))).toBe(37) expect(Math.floor(Unit.toPx(10, 'cm'))).toBe(376) expect(Math.floor(Unit.toPx(10, 'in'))).toBe(956) expect(Math.floor(Unit.toPx(10, 'pt'))).toBe(13) expect(Math.floor(Unit.toPx(10, 'pc'))).toBe(159) }) }) })