Skip to content

Commit e6294fe

Browse files
committed
Adds failing test-case
Given you want to merge two lists, when they share one claim but the claim contains common and an extra claim, and another claim in the second claim-object, then you get a result with duplicate claims lists with duplicate claims
1 parent 807aa7a commit e6294fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unit/ResponseValidator.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,14 @@ describe("ResponseValidator", function () {
538538

539539
});
540540

541+
it("should merge claims when claim types are objects", function () {
542+
543+
var c1 = { custom: {'apple': 'foo', 'pear': 'bar'} };
544+
var c2 = { custom: {'apple': 'foo', 'orange': 'peel'}, b: 'banana' };
545+
var result = subject._mergeClaims(c1, c2);
546+
result.should.deep.equal({ custom: {'apple': 'foo', 'pear': 'bar', 'orange': 'peel'}, b: 'banana' });
547+
});
548+
541549
it("should merge same claim types into array", function () {
542550

543551
var c1 = { a: 'apple', b: 'banana' };

0 commit comments

Comments
 (0)