generated from hmcts/expressjs-template
-
Notifications
You must be signed in to change notification settings - Fork 5
PUB-3003 Updated getPublicationsByLocation calls on frontend #1552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KianKwa
wants to merge
18
commits into
master
Choose a base branch
from
PUB-3003
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6b19e1e
Fixed e2e test failure after 6.0.2 release (#1542)
KianKwa b80878d
PUB-3000 - Dependency updates (#1536)
ChrisS1512 9d0ae45
PUB-2980 Express v5 upgrade (#1535)
KianKwa 735a91c
PUB-2979 Upgrade connect-redis and migrate from ioredis (#1531)
KianKwa fa5c65e
Updated getPublicationsByLocation calls on frontend
KianKwa e584713
Lint fixes
KianKwa 6f5a82a
Lint fixes
KianKwa cfde2ba
Fixed test errors
KianKwa 5014f36
Fixed failing a11y test
KianKwa dddda68
Added check for integer location ID
KianKwa 9dfcc9c
Lint fixes
KianKwa 783b03a
Updated unit tests
KianKwa ef83129
Removed unneeded suppressions
KianKwa 2b90890
Merge master into PUB-3003
github-actions[bot] 2d931d3
Merge master into PUB-3003
github-actions[bot] 06837f3
Merge master into PUB-3003
github-actions[bot] 80b047c
Merge master into PUB-3003
github-actions[bot] 9febe23
Merge master into PUB-3003
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -5,12 +5,12 @@ import sinon from 'sinon'; | |
import fs from 'fs'; | ||
import path from 'path'; | ||
import { LocationService } from '../../../main/service/LocationService'; | ||
import { SummaryOfPublicationsService } from '../../../main/service/SummaryOfPublicationsService'; | ||
import { PublicationService } from '../../../main/service/PublicationService'; | ||
|
||
const publicationController = new SummaryOfPublicationsController(); | ||
const i18n = { | ||
'list-option': {}, | ||
error: { title: 'error' }, | ||
}; | ||
const court = { name: 'New Court', email: '[email protected]', contactNo: '0123456789' }; | ||
|
||
|
@@ -28,7 +28,7 @@ const additionalLocationInfo = { | |
sinon | ||
.stub(LocationService.prototype, 'getLocationById') | ||
.resolves(JSON.parse('{"name":"New Court", "email": "[email protected]", "contactNo": "0123456789"}')); | ||
sinon.stub(SummaryOfPublicationsService.prototype, 'getPublications').resolves(metadata); | ||
sinon.stub(PublicationService.prototype, 'getPublicationsByLocation').resolves(metadata); | ||
|
||
const additionalLocationInfoStub = sinon.stub(LocationService.prototype, 'getLocationMetadata'); | ||
additionalLocationInfoStub.withArgs(1).returns(null); | ||
|
@@ -139,6 +139,22 @@ describe('Get publications', () => { | |
responseMock.verify(); | ||
}); | ||
|
||
it('should render the error page if location ID is no a number', async () => { | ||
const response = { | ||
render: () => { | ||
return ''; | ||
}, | ||
} as unknown as Response; | ||
const request = mockRequest(i18n); | ||
request.query = { locationId: 'Test2' }; | ||
request.user = { userId: 1 }; | ||
const responseMock = sinon.mock(response); | ||
responseMock | ||
.expects('render') | ||
.once() | ||
.withArgs('error', { ...i18n.error }); | ||
}); | ||
|
||
it('should render the error screen if there is no locationId passed as a param', async () => { | ||
const response = { | ||
render: () => { | ||
|
@@ -148,6 +164,9 @@ describe('Get publications', () => { | |
const request = mockRequest(i18n); | ||
request.user = { userId: 1 }; | ||
const responseMock = sinon.mock(response); | ||
responseMock.expects('render').once().withArgs('error'); | ||
responseMock | ||
.expects('render') | ||
.once() | ||
.withArgs('error', { ...i18n.error }); | ||
}); | ||
}); |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.