UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

18 lines (16 loc) 585 B
import { describe, expect, it } from 'vitest'; import { getFabricDocument } from '../../env'; import { setStyle } from './dom_style'; /** * Running this test in browser mode since jsdom doesn't implement `cssText` properly */ describe('dom_style', () => { describe('setStyle', () => { it('applies styles to DOM elements from strings and objects', () => { const el = getFabricDocument().createElement('div'); setStyle(el, { color: 'yellow', width: '45px' }); expect(el.style.color).toBe('yellow'); expect(el.style.width).toBe('45px'); }); }); });