destroyList.push(3)} />
destroyList.push(4)} />
);
let store = new Store();
const component = await createTestRenderer(store, widget);
await act(async () => {
store.set("index", 0);
});
component.toJSON();
assert.deepEqual(destroyList, []);
await act(async () => {
store.set("index", 3);
});
component.toJSON();
assert.deepEqual(destroyList, [0]);
await act(async () => {
store.set("index", 1);
});
component.toJSON();
assert.deepEqual(destroyList, [0, 3]);
await act(async () => {
store.set("index", 4);
});
component.toJSON();
assert.deepEqual(destroyList, [0, 3, 1]);
await act(async () => {
store.set("index", 0);
});
component.toJSON();
assert.deepEqual(destroyList, [0, 3, 1, 4]);
await act(async () => {
store.set("index", -1);
});
component.toJSON();
assert.deepEqual(destroyList, [0, 3, 1, 4, 0]);
});
});