Skip to content

Commit

Permalink
fix: fix bug missing deps in useMemo
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Jan 24, 2024
1 parent 481db7e commit 64e9733
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ describe('ClaimNameFatFingerModal', () => {
expect(onClaimMock).not.toHaveBeenCalledWith(name)
})
})
})
describe('when clicking the claim button', () => {
beforeEach(() => {
getSignerMock.mockResolvedValueOnce(
(signerMock as unknown) as ethers.providers.JsonRpcSigner
)
;(DCLController__factory.connect as jest.Mock).mockResolvedValueOnce({
interface: {
encodeFunctionData: jest.fn()
}
})
})
it('should open FIAT gateway widget when claim button is clicked', async () => {
const { getByRole, getByText } = renderWithProviders(
<ClaimNameFatFingerModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ const ClaimNameFatFingerModal = ({
}
}, [wallet, ENSName, analytics, onOpenFiatGateway, onClaimTxSubmitted])

const isLoading = useMemo(() => isClaiming || isLoadingFIATWidget, [])
const isLoading = useMemo(() => isClaiming || isLoadingFIATWidget, [
isClaiming,
isLoadingFIATWidget
])

const handleClaimWithCardClick = useCallback(() => {
return isClaimingNamesWithFiatEnabled && !isLoading
Expand Down

0 comments on commit 64e9733

Please sign in to comment.