import { assert } from './testUtils'
describe('compiler: transform slot', () => {
test('basic', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return {}
}`
)
assert(
``,
``,
`(_ctx, _cache) => {
return {}
}`
)
})
test('dynamic', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return { a: _d(_ctx.name) }
}`
)
})
test('fallback content', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return {}
}`
)
})
test('names slots', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return {}
}`
)
})
test('names slots with fallback content', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return {}
}`
)
})
test('slot with v-for', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return { a: _f(_ctx.items, (item, index, i0) => { return { a: "d-" + i0, b: _r("d", { key: index }, i0) }; }) }
}`
)
})
test('slot with v-for + v-for', () => {
assert(
``,
``,
`(_ctx, _cache) => {
return { a: _f(_ctx.items, (item, index, i0) => { return { a: _f(item.list, (item1, index1, i1) => { return { a: "d-" + i0 + '-' + i1, b: _r("d", { key: index1 }, i1) }; }), b: index }; }) }
}`
)
})
})