feat(planner): add isLoading prop to SwapSuggestionList — disables Pick buttons during PATCH
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,18 @@ describe('SwapSuggestionList', () => {
|
||||
expect(screen.getByTestId('swap-empty-state')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('disables all Wählen buttons when isLoading is true', () => {
|
||||
render(SwapSuggestionList, { props: { ...baseProps, isLoading: true } });
|
||||
const buttons = screen.getAllByRole('button', { name: /Wählen/i });
|
||||
buttons.forEach((btn) => expect((btn as HTMLButtonElement).disabled).toBe(true));
|
||||
});
|
||||
|
||||
it('Wählen buttons are enabled when isLoading is false', () => {
|
||||
render(SwapSuggestionList, { props: { ...baseProps, isLoading: false } });
|
||||
const buttons = screen.getAllByRole('button', { name: /Wählen/i });
|
||||
buttons.forEach((btn) => expect((btn as HTMLButtonElement).disabled).toBe(false));
|
||||
});
|
||||
|
||||
it('renders optional Abbrechen button when oncancel provided', () => {
|
||||
render(SwapSuggestionList, { props: { ...baseProps, oncancel: vi.fn() } });
|
||||
expect(screen.getByRole('button', { name: /Abbrechen/i })).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user