Skip to content

Commit

Permalink
test fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
baileycash-elastic committed Feb 20, 2025
1 parent 144c6f7 commit 36dd211
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ import { ApiKeyBtn } from './api_key_btn';
import { render } from '../../../utils/testing';

describe('<APIKeyButton />', () => {
const setLoadAPIKey = jest.fn();

const clickCallback = jest.fn();

it('calls delete monitor on monitor deletion', async () => {
render(<ApiKeyBtn apiKey="" loading={false} onClick={clickCallback} />);

expect(screen.getByText('Generate Project API key')).toBeInTheDocument();
await userEvent.click(screen.getByTestId('uptimeMonitorManagementApiKeyGenerate'));
expect(setLoadAPIKey).toHaveBeenCalled();
expect(clickCallback).toHaveBeenCalled();
});

it('shows correct content on loading', () => {
Expand Down

0 comments on commit 36dd211

Please sign in to comment.