Skip to content

Commit

Permalink
test SSOLogin
Browse files Browse the repository at this point in the history
  • Loading branch information
zburke committed May 15, 2024
1 parent 3bb2e99 commit e954610
Showing 1 changed file with 21 additions and 0 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')

Check failure on line 10 in src/components/SSOLogin/SSOLogin.test.js

View workflow job for this annotation

GitHub Actions / build-npm

Missing semicolon

Check failure on line 10 in src/components/SSOLogin/SSOLogin.test.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Missing semicolon
});

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

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

0 comments on commit e954610

Please sign in to comment.