import { describe, it, assert } from 'vitest' import * as Style from '../src/style/index.js' describe('Props', () => { describe('Shadow', () => { it('should expand empty properties', () => { assert.deepEqual(Style.Decoration.BoxShadow(), { boxShadowInset: false, boxShadowOffsetX: { value: 0, unit: 'px' }, boxShadowOffsetY: { value: 0, unit: 'px' }, boxShadowBlurRadius: { value: 0, unit: 'px' }, boxShadowSpreadRadius: { value: 0, unit: 'px' }, boxShadowColor: { id: null, alpha: null } }) }) it('should normalize properties', () => { assert.deepEqual( Style.Decoration.BoxShadow({ boxShadowInset: 'true', boxShadowOffsetX: '1px', boxShadowOffsetY: '2', boxShadowBlurRadius: 3, boxShadowSpreadRadius: { value: 4, unit: null }, boxShadowColor: { id: 'abc', alpha: null } }), { boxShadowInset: true, boxShadowOffsetX: { value: 1, unit: 'px' }, boxShadowOffsetY: { value: 2, unit: 'px' }, boxShadowBlurRadius: { value: 3, unit: 'px' }, boxShadowSpreadRadius: { value: 4, unit: 'px' }, boxShadowColor: { id: 'abc', alpha: null } } ) }) it('should normalize zero unit length properties', () => { assert.deepEqual( Style.Decoration.BoxShadow({ boxShadowInset: 'true', boxShadowOffsetX: '1px', boxShadowOffsetY: 0, boxShadowBlurRadius: 3, boxShadowSpreadRadius: { value: 4, unit: null }, boxShadowColor: { id: 'abc', alpha: null } }), { boxShadowInset: true, boxShadowOffsetX: { value: 1, unit: 'px' }, boxShadowOffsetY: { value: 0, unit: 'px' }, boxShadowBlurRadius: { value: 3, unit: 'px' }, boxShadowSpreadRadius: { value: 4, unit: 'px' }, boxShadowColor: { id: 'abc', alpha: null } } ) }) it('should validate properties', () => { assert.equal( Style.Decoration.BoxShadow.isValid( Style.Decoration.BoxShadow({ boxShadowInset: false, boxShadowOffsetX: { value: 0, unit: 'px' }, boxShadowOffsetY: { value: 0, unit: 'px' }, boxShadowBlurRadius: { value: 0, unit: 'px' }, boxShadowSpreadRadius: { value: 0, unit: 'px' }, boxShadowColor: { id: null, name: null, alpha: null } }) ), false ) }) }) })