fix(core): update
This commit is contained in:
14
test/test.ts
14
test/test.ts
@ -36,18 +36,20 @@ tap.test('should select something', async () => {
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('should dispatch a state action', async (tools) => {
|
||||
tap.test('should dispatch a state action', async tools => {
|
||||
const done = tools.defer();
|
||||
const addFavourite = testStatePart.createAction<string>(async (statePart, payload) => {
|
||||
const currentState = statePart.getState();
|
||||
currentState.currentFavorites.push(payload);
|
||||
return currentState;
|
||||
});
|
||||
testStatePart.waitUntilPresent(state => {
|
||||
return state.currentFavorites[0];
|
||||
}).then(() => {
|
||||
done.resolve();
|
||||
});
|
||||
testStatePart
|
||||
.waitUntilPresent(state => {
|
||||
return state.currentFavorites[0];
|
||||
})
|
||||
.then(() => {
|
||||
done.resolve();
|
||||
});
|
||||
await testStatePart.dispatchAction(addFavourite, 'my favourite things');
|
||||
expect(testStatePart.getState().currentFavorites).to.include('my favourite things');
|
||||
await done.promise;
|
||||
|
Reference in New Issue
Block a user