Skip to content

Commit

Permalink
updated getname test
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevcs committed May 24, 2024
1 parent d019727 commit 8f645ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/web3-eth-ens/test/unit/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ describe('resolver', () => {

describe('name', () => {
it('getName', async () => {
const address = "0x314159265dd8dbb310642f98f50c066173c1259b";

const supportsInterfaceMock = jest
.spyOn(contract.methods, 'supportsInterface')
.mockReturnValue({
Expand All @@ -255,12 +257,13 @@ describe('resolver', () => {
});
});

await resolver.getName(ENS_NAME);
await resolver.getName(address);
expect(supportsInterfaceMock).toHaveBeenCalledWith(
interfaceIds[methodsInInterface.name],
);

expect(nameMock).toHaveBeenCalledWith(namehash(ENS_NAME));
const reverseName = `${address.toLowerCase().substring(2)}.addr.reverse`;
expect(nameMock).toHaveBeenCalledWith(namehash(reverseName));
})
})

Expand Down

0 comments on commit 8f645ae

Please sign in to comment.