fix(tests): add test coverage for missed branches in AlertGrid

This commit is contained in:
Łukasz Mierzwa
2018-09-02 16:50:50 +01:00
parent fbdea79354
commit ba6ed7f9ff

View File

@@ -89,6 +89,15 @@ describe("<AlertGrid />", () => {
expect(instance.masonryComponentReference.ref.forcePack).toHaveBeenCalled();
});
it("masonryRepack() doesn't crash when masonryComponentReference.ref=false`", () => {
const tree = ShallowAlertGrid();
const instance = tree.instance();
const repackSpy = jest.spyOn(instance, "masonryRepack");
instance.masonryComponentReference.ref = false;
instance.componentDidUpdate();
expect(repackSpy).toHaveBeenCalled();
});
it("calling storeMasonryRef() saves the ref in local store", () => {
const tree = ShallowAlertGrid();
const instance = tree.instance();