-
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
Check your answers page with notes for additions, changes and deletions #923
Check your answers page with notes for additions, changes and deletions #923
Conversation
https://eaflood.atlassian.net/browse/WATER-4291 This feature will allow the user to see notifications on the page when a note is added, changed or deleted.
…ur-answers-page-with-a-cs-for-notes-add-change-delete
…ur-answers-page-with-a-cs-for-notes-add-change-delete
6954abd
to
4bacf6f
Compare
…ur-answers-page-with-a-cs-for-notes-add-change-delete
9bafb5c
to
04314cf
Compare
…ur-answers-page-with-a-cs-for-notes-add-change-delete
ab94f1f
to
b53b887
Compare
…ur-answers-page-with-a-cs-for-notes-add-change-delete
…ur-answers-page-with-a-cs-for-notes-add-change-delete
5b51a6a
to
9228ff3
Compare
9228ff3
to
8fb7589
Compare
…ur-answers-page-with-a-cs-for-notes-add-change-delete
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.
A few changes needed and then this will be ship-shape and bristol fashion!
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.
Wherever we use Sinon we need to add a restore()
at the tope level in an afterEach()
block.
afterEach(() => {
Sinon.restore()
})
await DeleteNoteService.go(session.id, yarStub) | ||
expect(session.note).to.be.undefined() |
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.
First, a NIT, adding some whitespace. But also this test is incorrect.
It is currently passing because we never set the property session.note
but do set the property session.data.note
. If you update the test to check for that it will fail because session.data.note
is defined.
You need to do this to fix the test and properly check the note has been deleted.
await DeleteNoteService.go(session.id, yarStub) | |
expect(session.note).to.be.undefined() | |
await DeleteNoteService.go(session.id, yarStub) | |
const refreshedSession = await session.$query() | |
expect(refreshedSession.data.note).to.be.undefined() |
However, this still won't pass unless the DeleteNoteService
is updated to drop the note
property instead of setting it to an empty string.
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.
makes sense, updated
async function _save (session) { | ||
const currentData = session.data | ||
|
||
currentData.note = '' |
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.
If we want to delete the note we ideally want to put it back to the state it was before we added one in the first place. If that is the case I think you need to call this instead.
currentData.note = '' | |
delete currentData.note |
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.
I agree, this should have been the approach. updated
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
…ur-answers-page-with-a-cs-for-notes-add-change-delete
…ur-answers-page-with-a-cs-for-notes-add-change-delete
…ur-answers-page-with-a-cs-for-notes-add-change-delete
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.
Co-authored-by: Alan Cruikshanks <[email protected]>
…ur-answers-page-with-a-cs-for-notes-add-change-delete
…ur-answers-page-with-a-cs-for-notes-add-change-delete
https://eaflood.atlassian.net/browse/WATER-4291
This feature allows the user to see notifications on the page when a note is added, changed or deleted.
A
delete-note
service has been added which is accessed via a simple GET request. This will delete any note in the session attached to the requirement.Notifications are shown using hapi/yar and are immediately removed upon first view on the page.
Screenshots