-
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
Set up session table (return requirements) #594
Conversation
https://eaflood.atlassian.net/browse/WATER-4257 We need to store user journeys as people progress through the screens and we need a table to store these in.
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.
Just the tweak-y-est of tweaks! 😁
test/models/session.model.test.js
Outdated
// Thing under test | ||
const SessionModel = require('../../app/models/session.model.js') | ||
|
||
describe('Sessions model', () => { |
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.
describe('Sessions model', () => { | |
describe('Session model', () => { |
const defaults = { | ||
id: generateUUID(), | ||
data: {} | ||
} |
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 a table automatically generates an ID we don't tend to set one in the helper. If you've seen us do this it should normally come with a note saying the previous team failed to implement an automatic UUID on insert in the underlying table, hence the need to do it.
So, we just focus on setting meaningful defaults to reflect what an instantiated record would typically look like.
In this particular case data: {}
could be what we often find. So, I'd suggest one of the following, I'll leave you to decide which one to go with!
const defaults = {
data: { licenceId: '01/128' }
}
Or whatever pretend test values you'd like to set in
data:
or
const defaults = {}
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.
https://eaflood.atlassian.net/browse/WATER-4257
We need to store user journeys as people progress through the screens and we need a table to store these in.