vue3-core/packages/compiler-ssr/__tests__/ssrTransition.spec.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
827 B
TypeScript
Raw Normal View History

import { compile } from '../src'
describe('transition', () => {
test('basic', () => {
expect(compile(`<transition><div>foo</div></transition>`).code)
.toMatchInlineSnapshot(`
2023-12-05 10:47:38 +08:00
"const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
2023-12-05 10:47:38 +08:00
return function ssrRender(_ctx, _push, _parent, _attrs) {
_push(\`<div\${_ssrRenderAttrs(_attrs)}>foo</div>\`)
}"
`)
})
test('with appear', () => {
expect(compile(`<transition appear><div>foo</div></transition>`).code)
.toMatchInlineSnapshot(`
2023-12-05 10:47:38 +08:00
"const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
2023-12-05 10:47:38 +08:00
return function ssrRender(_ctx, _push, _parent, _attrs) {
_push(\`<template><div\${_ssrRenderAttrs(_attrs)}>foo</div></template>\`)
}"
`)
})
})