Skip to content

Commit

Permalink
fix: correct party outbound response (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleyow authored May 12, 2022
1 parent 52d2b3f commit 752e8b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/model/PartiesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ function argsValidation({ type, id, subId }) {
*/
function reformatMessage(message) {
return {
party: { ...message }
party: {
body: { ...message.body.party },
headers: { ...message.headers }
}
};
}

Expand Down
5 changes: 4 additions & 1 deletion test/unit/lib/model/PartiesModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ describe('PartiesModel', () => {

// check that this.context.data is updated
expect(model.context.data).toEqual({
party: { ...message },
party: {
body: { ...message.body.party },
headers: { ...message.headers }
},
// current state will be updated by onAfterTransition which isn't called
// when manual invocation of transition handler happens
currentState: 'start'
Expand Down

0 comments on commit 752e8b4

Please sign in to comment.