Skip to content

Commit

Permalink
Test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KshitijThareja committed Aug 14, 2024
1 parent b670c4c commit cfb1395
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/pages/testing-playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
-->
<div id="testing-playground" style="padding: 24px">
<component :is="component" v-bind="componentProps">
<template v-for="(slot, name) in slots" :slot="[name === 'default' ? '' : name]">
<template v-for="(slot, name) in slots">
<component
:key="name"
v-if="slot.element"
:is="slot.element"
v-bind="slot.elementProps"
Expand Down
6 changes: 4 additions & 2 deletions lib/buttons-and-links/__tests__/KButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,20 @@ describe('KButton', () => {
await takeSnapshot('KButton - Dropdown Opened', { widths: [400], minHeight: 512 });
});

it('should render the slot when the slot has content', async () => {
it('should render the default slot when provided', async () => {
await renderComponent(
'KButton',
{ text: 'Button' },
{
default: {
element: 'span',
innerHTML: 'Default Slot Test',
elementProps: { class: 'default-slot-class' },
innerHTML: '<span>Default Slot Content</span>',
},
}
);
await takeSnapshot('KButton - With Default Slot', { widths: [400], minHeight: 512 });
});

});
});

0 comments on commit cfb1395

Please sign in to comment.