})
describe('toggle on-off', () => {
- async function testToggleOnOff({
- trueBranch,
- trueSerialized,
- falseBranch,
- falseSerialized
- }: ToggleOptions) {
+ async function testToggleOnOff(
+ {
+ trueBranch,
+ trueSerialized,
+ falseBranch,
+ falseSerialized
+ }: ToggleOptions,
+ mode?: BaseTransitionProps['mode']
+ ) {
const toggle = ref(true)
- const { props, cbs } = mockProps()
+ const { props, cbs } = mockProps({ mode })
const root = mount(
props,
() => (toggle.value ? trueBranch() : falseBranch())
falseSerialized: `<!---->`
})
})
+
+ test('w/ mode: "in-out', async () => {
+ await testToggleOnOff(
+ {
+ trueBranch: () => h('div'),
+ trueSerialized: `<div></div>`,
+ falseBranch: () => null,
+ falseSerialized: `<!---->`
+ },
+ 'in-out'
+ )
+ })
})
describe('toggle on-off before finish', () => {