Skip to content

Commit e312959

Browse files
test(signers): update draggable stub for vuedraggable 4 slot API
The draggable stub must render the #item named slot (not the default slot) to match vuedraggable 4's internal contract. Without this the stub never renders any Signer children, making all rendering assertions pass vacuously. - Replace template '<div><slot /></div>' with a loop over modelValue that yields '<slot name="item" :element :index />' per entry - Add itemKey to accepted props (vuedraggable 4 requires it) - Remove transition-group stub (no longer used in Signers.vue) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 7aaf9eb commit e312959

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/tests/components/Signers/Signers.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ describe('Signers', () => {
3636
plugins: [pinia],
3737
stubs: {
3838
Signer: true,
39+
// Stub for vuedraggable 4 (Vue 3) which uses #item slot per element
3940
draggable: {
4041
name: 'draggable',
41-
template: '<div><slot /></div>',
42-
props: ['modelValue', 'tag', 'handle', 'class', 'chosenClass', 'dragClass'],
43-
},
44-
'transition-group': {
45-
name: 'transition-group',
46-
template: '<div><slot /></div>',
42+
template: `
43+
<div>
44+
<template v-for="(element, index) in modelValue" :key="index">
45+
<slot name="item" :element="element" :index="index" />
46+
</template>
47+
</div>
48+
`,
49+
props: ['modelValue', 'itemKey', 'tag', 'handle', 'class', 'chosenClass', 'dragClass'],
4750
},
4851
},
4952
},

0 commit comments

Comments
 (0)