-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into STCOR-926
- Loading branch information
Showing
45 changed files
with
252 additions
and
115 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* @folio-org/stripes-force | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { render, screen } from '@folio/jest-config-stripes/testing-library/react'; | ||
|
||
import BadRequestScreen from './BadRequestScreen'; | ||
|
||
jest.mock('../../Pluggable', () => (props) => props.children); | ||
|
||
describe('BadRequestScreen', () => { | ||
it('renders expected message', () => { | ||
render(<BadRequestScreen />); | ||
|
||
screen.getByText('stripes-core.front.error.header'); | ||
screen.getByText(/stripes-core.front.error.general.message/); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { render, screen } from '@folio/jest-config-stripes/testing-library/react'; | ||
|
||
import { useStripes } from '../../StripesContext'; | ||
import Stripes from '../../Stripes'; | ||
import IfInterface from './IfInterface'; | ||
|
||
jest.mock('../../StripesContext'); | ||
const stripes = new Stripes({ | ||
discovery: { | ||
interfaces: { | ||
foo: '1.0' | ||
} | ||
}, | ||
logger: { | ||
log: jest.fn(), | ||
} | ||
}); | ||
|
||
// IfInterface is just a component version of Stripes::hasInterface | ||
// See more extensive tests there. | ||
describe('IfInterface', () => { | ||
it('returns true if interface is present', () => { | ||
useStripes.mockReturnValue(stripes); | ||
render(<IfInterface name="foo">monkey</IfInterface>); | ||
expect(screen.queryByText(/monkey/)).toBeTruthy(); | ||
}); | ||
|
||
it('returns false if interface is absent', () => { | ||
useStripes.mockReturnValue(stripes); | ||
render(<IfInterface name="paul,is,dead">monkey</IfInterface>); | ||
expect(screen.queryByText(/monkey/)).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/components/ResetPasswordNotAvailableScreen/ResetPasswordNotAvailableScreen.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { render, screen } from '@folio/jest-config-stripes/testing-library/react'; | ||
|
||
import BadRequestScreen from './ResetPasswordNotAvailableScreen'; | ||
|
||
jest.mock('../../Pluggable', () => (props) => props.children); | ||
|
||
describe('ResetPasswordNotAvailableScreen', () => { | ||
it('renders expected message', () => { | ||
render(<BadRequestScreen />); | ||
|
||
screen.getByText('stripes-core.front.error.header'); | ||
screen.getByText('stripes-core.front.error.setPassword.message'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.