1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-27 13:49:10 +02:00
This commit is contained in:
sjaanus 2024-05-14 10:03:06 +03:00
parent f461c3c299
commit eb38f4c6cf
No known key found for this signature in database
GPG Key ID: 20E007C0248BA7FF

View File

@ -30,7 +30,7 @@ test('dialog opens correctly and can be closed', async () => {
setup(); setup();
expect(screen.getByText('Mark completed')).toBeInTheDocument(); expect(screen.getByText('Mark completed')).toBeInTheDocument();
userEvent.click(screen.getByText('Cancel')); await userEvent.click(screen.getByText('Cancel'));
expect(setIsOpen).toHaveBeenCalledWith(false); expect(setIsOpen).toHaveBeenCalledWith(false);
}); });
@ -38,26 +38,26 @@ test('selecting options updates state appropriately', async () => {
setup(); setup();
const radioKept = screen.getByLabelText('We decided to keep the feature'); const radioKept = screen.getByLabelText('We decided to keep the feature');
userEvent.click(radioKept); await userEvent.click(radioKept);
expect(radioKept).toBeChecked(); expect(radioKept).toBeChecked();
const radioDiscarded = screen.getByLabelText( const radioDiscarded = screen.getByLabelText(
'We decided to discard the feature', 'We decided to discard the feature',
); );
userEvent.click(radioDiscarded); await userEvent.click(radioDiscarded);
expect(radioDiscarded).toBeChecked(); expect(radioDiscarded).toBeChecked();
const radioVariant = screen.getByLabelText( const radioVariant = screen.getByLabelText(
'We decided to keep the feature variant', 'We decided to keep the feature variant',
); );
userEvent.click(radioVariant); await userEvent.click(radioVariant);
expect(radioVariant).toBeChecked(); expect(radioVariant).toBeChecked();
}); });
test('variant selection is shown when appropriate', async () => { test('variant selection is shown when appropriate', async () => {
setup(); setup();
userEvent.click( await userEvent.click(
screen.getByLabelText('We decided to keep the feature variant'), screen.getByLabelText('We decided to keep the feature variant'),
); );