feat(twenty-front/Button): add loading state on Button (#10536)

This commit is contained in:
Antoine Moreaux
2025-03-03 11:04:32 +01:00
committed by GitHub
parent 2e4c596644
commit 51c34b77d9
19 changed files with 374 additions and 99 deletions

View File

@ -1,3 +1,4 @@
import { expect } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react';
import { within } from '@storybook/test';
@ -31,6 +32,12 @@ export const Default: Story = {
const canvas = within(canvasElement);
sleep(1000);
await canvas.findByRole('button', { name: 'View billing details' });
const buttons = await canvas.findAllByRole('button');
expect(
buttons.findIndex((button) =>
button.outerHTML.includes('View billing details'),
),
).toBeGreaterThan(-1);
},
};

View File

@ -1,3 +1,4 @@
import { expect } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react';
import { within } from '@storybook/test';
@ -30,6 +31,10 @@ export const Default: Story = {
await sleep(1000);
await canvas.getByRole('button', { name: 'Copy link' });
const buttons = await canvas.getAllByRole('button');
expect(
buttons.findIndex((button) => button.outerHTML.includes('Copy link')),
).toBeGreaterThan(-1);
},
};