@vtmn/svelte
Advanced tools
Comparing version 0.52.0 to 0.52.1
{ | ||
"name": "@vtmn/svelte", | ||
"version": "0.52.0", | ||
"version": "0.52.1", | ||
"description": "Decathlon Design System - Vitamin Svelte components library", | ||
@@ -131,3 +131,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "ff744cebd3c47e538a9204c370217ef96c751d44" | ||
"gitHead": "f960628edb2feb27ffee773495c63d2d0f254eeb" | ||
} |
@@ -8,1 +8,13 @@ /** | ||
}; | ||
export const VTMN_SKELETON_UNIT = { | ||
EM: 'em', | ||
REM: 'rem', | ||
VW: 'vw', | ||
CH: 'ch', | ||
PERCENT: '%', | ||
PX: 'px', | ||
}; | ||
export const VTMN_SKELETON_DEFAULT_WIDTH = 100; | ||
export const VTMN_SKELETON_DEFAULT_UNIT = VTMN_SKELETON_UNIT.PERCENT; |
@@ -46,2 +46,17 @@ import '@testing-library/jest-dom'; | ||
}); | ||
test('Should change the unit', () => { | ||
const { container } = render(VtmnSkeleton, { unit: 'px' }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100px'); | ||
}); | ||
test('Should set the unit as % if unit not found', () => { | ||
const { container } = render(VtmnSkeleton, { unit: 'foo', width: 50 }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100%'); | ||
}); | ||
test('Should set the width as 0 if width are negative', () => { | ||
const { container } = render(VtmnSkeleton, { width: -1, unit: 'px' }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100%'); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1481778
34975