()
| 218 | }) |
| 219 | |
| 220 | function runNestedPatchScenario() { |
| 221 | let nestedPatches = [] |
| 222 | const [nextState] = produceWithPatches(makeBaseState(), draft => { |
| 223 | const node = draft.children[0] |
| 224 | draft.children.splice(0, 1) // remove node from root |
| 225 | |
| 226 | const group = {id: 3, children: [node], groupName: ""} // new group |
| 227 | draft.children.splice(0, 0, group) // add group to root |
| 228 | |
| 229 | const [, patches] = produceWithPatches(draft, inner => { |
| 230 | const value = inner.children[0].children[0].value |
| 231 | inner.children[0].groupName = value + " Group" |
| 232 | }) |
| 233 | |
| 234 | nestedPatches = patches |
| 235 | applyPatches(draft, patches) |
| 236 | }) |
| 237 | |
| 238 | return {nextState, patches: nestedPatches} |
| 239 | } |
| 240 | |
| 241 | it("#916 nested patches with moved child draft", () => { |
| 242 | const {nextState, patches} = runNestedPatchScenario() |
no test coverage detected
searching dependent graphs…