ssrResolveCssVars.spec.ts 620 B

123456789101112131415161718192021222324252627
  1. import { ssrResolveCssVars } from '../src'
  2. describe('ssr: resolveCssVars', () => {
  3. test('should work', () => {
  4. expect(ssrResolveCssVars({ color: 'red' })).toMatchObject({
  5. style: {
  6. '--color': 'red'
  7. }
  8. })
  9. })
  10. test('should work with scopeId', () => {
  11. expect(ssrResolveCssVars({ color: 'red' }, 'scoped')).toMatchObject({
  12. style: {
  13. '--scoped-color': 'red'
  14. }
  15. })
  16. })
  17. test('should strip data-v prefix', () => {
  18. expect(ssrResolveCssVars({ color: 'red' }, 'data-v-123456')).toMatchObject({
  19. style: {
  20. '--123456-color': 'red'
  21. }
  22. })
  23. })
  24. })