Skip to content

Commit

Permalink
fix: null values check
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccio98 committed May 13, 2023
1 parent 0690bb3 commit 0d5897f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/buildingsUtils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ describe('addBuilding', () => {
userId: user._id
};
api.buildings.addBuilding = vi.fn().mockRejectedValue({});
api.buildings.fetchBuildings = vi.fn().mockResolvedValue([]);
api.buildings.fetchBuildingsByUserId = vi.fn().mockResolvedValue([]);
await addBuilding('Building A', 'John Doe', 'New York', '1000', 'Office', 40.7128, -74.006, [1, 2], user, setShow, dispatch);
expect(api.buildings.addBuilding).toHaveBeenCalledWith(data);
expect(api.buildings.fetchBuildings).not.toHaveBeenCalled();
expect(api.buildings.fetchBuildingsByUserId).not.toHaveBeenCalled();
expect(setShow).toHaveBeenCalledWith(true);
});
});

0 comments on commit 0d5897f

Please sign in to comment.