@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
9 lines (8 loc) • 358 B
JavaScript
import { createElement } from '../test-helpers/createElement.spec';
import { getElementWidth } from './getElementWidth';
describe('getElementWidth', () => {
it('should return the width of an element as a number', () => {
const element = createElement('div', { width: '100px' });
expect(getElementWidth(element)).toEqual(100);
});
});