From 66b71c84d140cca0f3545b5e7ca8d6e69530085f Mon Sep 17 00:00:00 2001 From: KshitijThareja Date: Thu, 15 Aug 2024 00:25:07 +0530 Subject: [PATCH] Test changes --- .../__tests__/KButton.spec.js | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/lib/buttons-and-links/__tests__/KButton.spec.js b/lib/buttons-and-links/__tests__/KButton.spec.js index 720b84a02..e795d4c82 100644 --- a/lib/buttons-and-links/__tests__/KButton.spec.js +++ b/lib/buttons-and-links/__tests__/KButton.spec.js @@ -73,64 +73,64 @@ describe('KButton', () => { }); describe.visual('KButton Visual Tests', () => { - // it('renders correctly with different appearances', async () => { - // await renderComponent('KButton', { - // text: 'Raised Button', - // primary: true, - // appearance: 'raised-button', - // }); - // await takeSnapshot('KButton - Primary Raised Button', { widths: [400], minHeight: 512 }); + it('renders correctly with different appearances', async () => { + await renderComponent('KButton', { + text: 'Raised Button', + primary: true, + appearance: 'raised-button', + }); + await takeSnapshot('KButton - Primary Raised Button', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { - // text: 'Raised Button', - // primary: false, - // appearance: 'raised-button', - // }); - // await takeSnapshot('KButton - Secondary Raised Button', { widths: [400], minHeight: 512 }); + await renderComponent('KButton', { + text: 'Raised Button', + primary: false, + appearance: 'raised-button', + }); + await takeSnapshot('KButton - Secondary Raised Button', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { - // text: 'Flat Button', - // primary: true, - // appearance: 'flat-button', - // }); - // await takeSnapshot('KButton - Primary Flat Button', { widths: [400], minHeight: 512 }); + await renderComponent('KButton', { + text: 'Flat Button', + primary: true, + appearance: 'flat-button', + }); + await takeSnapshot('KButton - Primary Flat Button', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { - // text: 'Flat Button', - // primary: false, - // appearance: 'flat-button', - // }); - // await takeSnapshot('KButton - Secondary Flat Button', { widths: [400], minHeight: 512 }); + await renderComponent('KButton', { + text: 'Flat Button', + primary: false, + appearance: 'flat-button', + }); + await takeSnapshot('KButton - Secondary Flat Button', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { text: 'Basic Link', appearance: 'basic-link' }); - // await takeSnapshot('KButton - Basic Link', { widths: [400], minHeight: 512 }); - // }); - // it('renders correctly when disabled', async () => { - // await renderComponent('KButton', { - // text: 'Raised Button', - // disabled: true, - // appearance: 'raised-button', - // }); - // await takeSnapshot('KButton - Disabled Raised Button', { widths: [400], minHeight: 512 }); + await renderComponent('KButton', { text: 'Basic Link', appearance: 'basic-link' }); + await takeSnapshot('KButton - Basic Link', { widths: [400], minHeight: 512 }); + }); + it('renders correctly when disabled', async () => { + await renderComponent('KButton', { + text: 'Raised Button', + disabled: true, + appearance: 'raised-button', + }); + await takeSnapshot('KButton - Disabled Raised Button', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { - // text: 'Flat Button', - // disabled: true, - // appearance: 'flat-button', - // }); - // await takeSnapshot('KButton - Disabled Flat Button', { widths: [400], minHeight: 512 }); - // }); - // it('renders with hover state', async () => { - // await renderComponent('KButton', { text: 'Raised Button', appearance: 'raised-button' }); - // await hover('button'); - // await delay(4000); - // await takeSnapshot('KButton - Raised Button Hover', { widths: [400], minHeight: 512 }); + await renderComponent('KButton', { + text: 'Flat Button', + disabled: true, + appearance: 'flat-button', + }); + await takeSnapshot('KButton - Disabled Flat Button', { widths: [400], minHeight: 512 }); + }); + it('renders with hover state', async () => { + await renderComponent('KButton', { text: 'Raised Button', appearance: 'raised-button' }); + await hover('button'); + await delay(4000); + await takeSnapshot('KButton - Raised Button Hover', { widths: [400], minHeight: 512 }); - // await renderComponent('KButton', { text: 'Flat Button', appearance: 'flat-button' }); - // await hover('button'); - // await delay(4000); - // await takeSnapshot('KButton - Flat Button Hover', { widths: [400], minHeight: 512 }); - // }); + await renderComponent('KButton', { text: 'Flat Button', appearance: 'flat-button' }); + await hover('button'); + await delay(4000); + await takeSnapshot('KButton - Flat Button Hover', { widths: [400], minHeight: 512 }); + }); it('renders correctly with icon and iconAfter', async () => { await renderComponent('KButton', { text: 'Icon Button', icon: 'add' }); await takeSnapshot('KButton - With Icons', { widths: [400], minHeight: 512 }); @@ -159,8 +159,7 @@ describe('KButton', () => { { text: 'Button' }, { default: { - element: 'span', - elementProps: { class: 'default-slot-class' }, + element: 'div', innerHTML: 'Default Slot Content', }, }