-
Notifications
You must be signed in to change notification settings - Fork 0
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
VB-3725 Select visitors page: add prison-specific visitor config #52
Conversation
tpmcgowan
commented
May 14, 2024
•
edited
Loading
edited
- Look up prison config to show allowed visitor numbers/ages
- Add GOVUK Error summary component and associated Nunjucks filters for validation errors (copied from Admin UI)
- Update test utils to handle mocking session data and flash
- Add tests for Select visitors page GET and POST route
// selected visitors for this visit | ||
selectedVisitors?: VisitorInfoDto[] | ||
} | ||
|
||
export type FlashData = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For typing what we do with req.flash()
const app = express() | ||
|
||
app.set('view engine', 'njk') | ||
|
||
nunjucksSetup(app, testAppInfo) | ||
app.use(cookieSession({ keys: [''] })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing cookie-session
as it was interfering with simply passing through an object to mock req.session
- and it didn't appear to be doing anything useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the session stored if this is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically just a SessionData
object (defaulting to { }
) is now passed through so data can be seeded before requests and stuff can be 'saved' into it.
I guess without a 'proper' module like cookie-session
we're not getting any of the things like session.destroy()
- but nothing like that gets called. (Auth code does, but that's not included in this test app setup; it just assumes a logged in user.)
In Staff UI we removed this too. I think in the Admin UI its still there - but we don't use req.session
so doesn't matter.
@@ -26,7 +26,7 @@ | |||
<link href="/assets/stylesheets/application.css?{{ version }}" rel="stylesheet"/> | |||
{% endblock %} | |||
|
|||
{% block pageTitle %}{{pageTitle | default(applicationName)}}{% endblock %} | |||
{% block pageTitle %}{{ pageTitle + " - " if pageTitle }}{{ applicationName }} - GOV.UK{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standardise page title
s along GDS guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just the question re cookie-session