UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

24 lines (23 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const __1 = require(".."); const createElement_spec_1 = require("../test-helpers/createElement.spec"); describe('isDisplayInline', () => { it('should return true for a text node', () => { const element = (0, createElement_spec_1.createElement)('div'); element.innerHTML = 'text'; expect((0, __1.isDisplayInline)(element.childNodes[0])).toEqual(true); }); it('should return true for a natively inline element', () => { const element = (0, createElement_spec_1.createElement)('span'); expect((0, __1.isDisplayInline)(element)).toEqual(true); }); it('should return false for a natively inline element styled as anything other than display inline', () => { const element = (0, createElement_spec_1.createElement)('span', { display: 'inline-block ' }); expect((0, __1.isDisplayInline)(element)).toEqual(false); }); it('should return false for a natively non-inline element', () => { const element = (0, createElement_spec_1.createElement)('div'); expect((0, __1.isDisplayInline)(element)).toEqual(false); }); });