Skip to content
Myr

test: rename and expand a test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by aleclarson · committed by Alec Larson · parent 8e0325c · Browse files · 1 file+9 added−21 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−21 removed

  • tests:+9 added−21 removed

1 file+9 added−21 removed

modified:__tests__/base.js+9 added-21 removed
888 unmodified lines
889 expect(next1).not.toBe(base)890 expect(next1.x).toBe(4)891 })892893 it("issue #89", () => {894 const state = {895 users: {896 existingID: {897 loading: false,898 value: "val"899 }900 }901 }902 const nextState = produce(state, draft => {903 draft.users.existingID = {904 ...draft.users.existingID,905 loading: true906 }893 // See here: https://github.com/mweststrate/immer/issues/89894 it("works with the spread operator", () => {895 const base = {foo: {x: 0, y: 0}, bar: [0, 0]}896 const result = produce(base, draft => {897 draft.foo = {x: 1, ...draft.foo, y: 1}898 draft.bar = [1, ...draft.bar, 1]899 })908 expect(nextState).toEqual({909 users: {910 existingID: {911 loading: true,912 value: "val"913 }914 }900 expect(result).toEqual({901 foo: {x: 0, y: 1},902 bar: [1, 0, 0, 1]903 })904 })905906 it("processes with lodash.set", () => {
387 unmodified lines