Skip to content

Commit

Permalink
fixed normal pouring
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdugne committed Mar 7, 2021
1 parent 522cdd3 commit 1cb6704
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hooks/create-pour-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const createPourHook = store =>
return disconnect;
}, []);

return props ? {...props} : defaultPouring;
return props || defaultPouring;
};

// -----------------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions test/lib/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ test('no path should return object', t => {
t.deepEqual(res2, foo);
});

test('wrong string path', t => {
const res2 = get('plop.plup.plip', {});
test('unexistant string path', t => {
const res2 = get('plop.plip.plup', {});
t.is(res2, undefined);
});

test('nested array', t => {
const array = [1, 2, 3];
const plop = {plip: {plup: array}};

const res = get('plip.plup', plop);
t.is(res, array);
});

0 comments on commit 1cb6704

Please sign in to comment.