import { getCompiledString } from './utils'
describe('text', () => {
test('static text', () => {
expect(getCompiledString(`foo`)).toMatchInlineSnapshot(`"\`foo\`"`)
})
test('static text escape', () => {
expect(getCompiledString(`<foo>`)).toMatchInlineSnapshot(
`"\`<foo>\`"`
)
})
test('nested elements with static text', () => {
expect(
getCompiledString(`
hellobye
`)
).toMatchInlineSnapshot(
`"\`hellobye
\`"`
)
})
test('interpolation', () => {
expect(getCompiledString(`foo {{ bar }} baz`)).toMatchInlineSnapshot(
`"\`foo \${interpolate(_ctx.bar)} baz\`"`
)
})
test('nested elements with interpolation', () => {
expect(
getCompiledString(
`{{ foo }} barbaz {{ qux }}
`
)
).toMatchInlineSnapshot(
`"\`\${interpolate(_ctx.foo)} barbaz \${interpolate(_ctx.qux)}
\`"`
)
})
})