Skip to content

Commit

Permalink
test: src does not overwrite undefined dest values
Browse files Browse the repository at this point in the history
  • Loading branch information
luqven committed Jun 17, 2021
1 parent 55f3034 commit fe87f79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/propMerger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ describe('mergeProps()', () => {
}
)

it("should not overwrite destination resolving to `undefined` if source exists", () => {
const src = { domain: "foo.bar", height: 100 };
const destination = { height: undefined };
const result = mergeProps(src, destination);

expect(result).toEqual({ domain: "foo.bar", height: undefined });
});

it('should recursively merge imgixParams and htmlAttributes',
() => {
const src = {
Expand Down

0 comments on commit fe87f79

Please sign in to comment.