fix(css): box-shadow none handling (#10445)

closes https://github.com/NativeScript/NativeScript/issues/10403
This commit is contained in:
Nathan Walker
2023-11-19 15:30:07 -08:00
committed by GitHub
parent 5b9d861fa3
commit 67440095f4
7 changed files with 20 additions and 33 deletions

View File

@ -6,12 +6,7 @@ import { Color } from '../../color';
describe('css-shadow', () => {
it('empty', () => {
const shadow = parseCSSShadow('');
expect(shadow.inset).toBe(false);
expect(shadow.offsetX).toBeUndefined();
expect(shadow.offsetY).toBeUndefined();
expect(shadow.blurRadius).toBeUndefined();
expect(shadow.spreadRadius).toBeUndefined();
expect(shadow.color).toBeUndefined();
expect(shadow).toBeNull();
});
it('1px 1px 2px black', () => {
@ -137,33 +132,18 @@ describe('css-shadow', () => {
it('none', () => {
const shadow = parseCSSShadow('none');
expect(shadow.inset).toBe(false);
expect(shadow.offsetX).toBeUndefined();
expect(shadow.offsetY).toBeUndefined();
expect(shadow.blurRadius).toBeUndefined();
expect(shadow.spreadRadius).toBeUndefined();
expect(shadow.color).toBeUndefined();
expect(shadow).toBeNull();
});
it('unset', () => {
const shadow = parseCSSShadow('unset');
expect(shadow.inset).toBe(false);
expect(shadow.offsetX).toBeUndefined();
expect(shadow.offsetY).toBeUndefined();
expect(shadow.blurRadius).toBeUndefined();
expect(shadow.spreadRadius).toBeUndefined();
expect(shadow.color).toBeUndefined();
expect(shadow).toBeNull();
});
it('unset 5em 1em gold', () => {
// invalid shorthand should result in nothing being applied
const shadow = parseCSSShadow('unset 5em 1em gold');
expect(shadow.inset).toBe(false);
expect(shadow.offsetX).toBeUndefined();
expect(shadow.offsetY).toBeUndefined();
expect(shadow.blurRadius).toBeUndefined();
expect(shadow.spreadRadius).toBeUndefined();
expect(shadow.color).toBeUndefined();
expect(shadow).toBeNull();
});
it('5em 1em gold unset', () => {