ssrTransition.spec.ts 827 B

12345678910111213141516171819202122232425
  1. import { compile } from '../src'
  2. describe('transition', () => {
  3. test('basic', () => {
  4. expect(compile(`<transition><div>foo</div></transition>`).code)
  5. .toMatchInlineSnapshot(`
  6. "const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
  7. return function ssrRender(_ctx, _push, _parent, _attrs) {
  8. _push(\`<div\${_ssrRenderAttrs(_attrs)}>foo</div>\`)
  9. }"
  10. `)
  11. })
  12. test('with appear', () => {
  13. expect(compile(`<transition appear><div>foo</div></transition>`).code)
  14. .toMatchInlineSnapshot(`
  15. "const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
  16. return function ssrRender(_ctx, _push, _parent, _attrs) {
  17. _push(\`<template><div\${_ssrRenderAttrs(_attrs)}>foo</div></template>\`)
  18. }"
  19. `)
  20. })
  21. })