-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIU-2081: Show user-readable message when user is not found (#1687)
- Loading branch information
Showing
10 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/** @param {import('karma').Config} config */ | ||
module.exports = config => config.set({ client: { captureConsole: false } }); | ||
module.exports = config => config.set({ | ||
client: { | ||
captureConsole: false | ||
}, | ||
}); |
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,20 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
Pane, | ||
Layout, | ||
} from '@folio/stripes/components'; | ||
|
||
const ErrorPane = ({ children, ...props }) => ( | ||
<Pane defaultWidth="fill" {...props}> | ||
<Layout element="p" className="textCentered"> | ||
{children} | ||
</Layout> | ||
</Pane> | ||
); | ||
|
||
ErrorPane.propTypes = { | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default ErrorPane; |
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 @@ | ||
export { default } from './ErrorPane'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { | ||
interactor, | ||
isPresent, | ||
} from '@bigtest/interactor'; | ||
|
||
@interactor class UserNotFoundPage { | ||
userNotFoundPanePresent = isPresent('#pane-user-not-found-content'); | ||
|
||
whenLoaded() { | ||
return this.when(() => this.isPresent).timeout(5000); | ||
} | ||
} | ||
|
||
export default new UserNotFoundPage('#pane-user-not-found'); |
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,29 @@ | ||
import { | ||
beforeEach, | ||
describe, | ||
it, | ||
} from '@bigtest/mocha'; | ||
import { expect } from 'chai'; | ||
|
||
import setupApplication from '../helpers/setup-application'; | ||
import UserNotFoundPage from '../interactors/user-not-found-page'; | ||
|
||
describe('User not found', () => { | ||
setupApplication(); | ||
|
||
describe('visit users details for not existing user', () => { | ||
beforeEach(async function () { | ||
this.server.get('/users/not-found', () => { | ||
return new Response(404, {}); | ||
}, 404); | ||
|
||
this.visit('/users/view/not-found'); | ||
|
||
await UserNotFoundPage.whenLoaded(); | ||
}); | ||
|
||
it('shows user not found pane', () => { | ||
expect(UserNotFoundPage.userNotFoundPanePresent).to.equal(true); | ||
}); | ||
}); | ||
}); |
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