Skip to content

Commit e89ae09

Browse files
committed
test(mp-weixin): add tests for editor-portal component
1 parent e3ef6de commit e89ae09

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/uni-mp-weixin/__tests__/component.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,24 @@ describe('mp-weixin: transform component', () => {
309309
)
310310
})
311311

312+
test('editor-protal', () => {
313+
assert(
314+
`<editor id="editor"><editor-portal :key="blockId"><view class="flex"></view></editor-portal></editor>`,
315+
`<editor id="editor"><editor-portal key="{{a}}"><view class="flex"></view></editor-portal></editor>`,
316+
`(_ctx, _cache) => {
317+
return { a: _ctx.blockId }
318+
}`
319+
)
320+
321+
assert(
322+
`<editor id="editor"><template v-for="item in customBlockList" :key="item.blockId"><editor-portal :key="item.blockId"><view class="flex"></view></editor-portal></template></editor>`,
323+
`<editor id="editor"><block wx:for="{{a}}" wx:for-item="item" wx:key="b"><editor-portal key="{{item.a}}"><view class="flex"></view></editor-portal></block></editor>`,
324+
`(_ctx, _cache) => {
325+
return { a: _f(_ctx.customBlockList, (item, k0, i0) => { return { a: item.blockId, b: item.blockId }; }) }
326+
}`
327+
)
328+
})
329+
312330
// 暂不上线,先注释掉
313331
// test('input > keyboard-accessory', () => {
314332
// assert(

0 commit comments

Comments
 (0)