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 cfb1395 commit 66b71c8
Showing 1 changed file with 53 additions and 54 deletions.
107 changes: 53 additions & 54 deletions lib/buttons-and-links/__tests__/KButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -159,8 +159,7 @@ describe('KButton', () => {
{ text: 'Button' },
{
default: {
element: 'span',
elementProps: { class: 'default-slot-class' },
element: 'div',
innerHTML: '<span>Default Slot Content</span>',
},
}
Expand Down

0 comments on commit 66b71c8

Please sign in to comment.