Add test for farmwareReducer INIT_RESOURCE
This commit is contained in:
parent
0e314d9c66
commit
8c0bb4e883
|
@ -27,4 +27,16 @@ describe("famrwareReducer", () => {
|
|||
expect(newState.currentImage).not.toBeUndefined();
|
||||
expect(newState.currentImage).toBe(image.uuid);
|
||||
});
|
||||
|
||||
it("sets the current image via INIT_RESOURCE", () => {
|
||||
const image = fakeImage();
|
||||
const oldState: FarmwareState = { currentImage: undefined };
|
||||
const newState = famrwareReducer(oldState, {
|
||||
type: Actions.INIT_RESOURCE,
|
||||
payload: image
|
||||
});
|
||||
expect(oldState.currentImage).not.toEqual(newState.currentImage);
|
||||
expect(newState.currentImage).not.toBeUndefined();
|
||||
expect(newState.currentImage).toBe(image.uuid);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue