Skip to content

Commit

Permalink
test SSOLogin (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
zburke authored Dec 6, 2024
1 parent 85a6b57 commit c08b60d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 51 deletions.
21 changes: 21 additions & 0 deletions src/components/SSOLogin/SSOLogin.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { render, screen } from '@folio/jest-config-stripes/testing-library/react';
import userEvent from '@folio/jest-config-stripes/testing-library/user-event';

import SSOLogin from './SSOLogin';

describe('Login via SSO', () => {
it('renders a button', () => {
const fx = jest.fn();
render(<SSOLogin handleSSOLogin={fx} />);
screen.getByText('stripes-core.loginViaSSO');
});

it('calls the callback', async () => {
const fx = jest.fn();
render(<SSOLogin handleSSOLogin={fx} />);
await userEvent.click(screen.getByText('stripes-core.loginViaSSO'));

expect(fx).toHaveBeenCalled();
});
});

51 changes: 0 additions & 51 deletions src/components/SSOLogin/tests/SSOLogin-test.js

This file was deleted.

0 comments on commit c08b60d

Please sign in to comment.