diff --git a/test/SafeProtocolRegistry.spec.ts b/test/SafeProtocolRegistry.spec.ts index 846e83d9..87b315fe 100644 --- a/test/SafeProtocolRegistry.spec.ts +++ b/test/SafeProtocolRegistry.spec.ts @@ -68,7 +68,22 @@ describe("SafeProtocolRegistry", async () => { it("Should return true when valid interfaceId is passed", async () => { const { safeProtocolRegistry } = await loadFixture(deployContractFixture); - expect(await safeProtocolRegistry.supportsInterface("0x01ffc9a7")).to.be.equal(true); - expect(await safeProtocolRegistry.supportsInterface("0xc23697a8")).to.be.equal(true); + expect(await safeProtocolRegistry.supportsInterface("0x01ffc9a7")).to.be.true; + expect(await safeProtocolRegistry.supportsInterface("0xc23697a8")).to.be.true; + }); + + it("Should return false when invalid interfaceId is passed", async () => { + const { safeProtocolRegistry } = await loadFixture(deployContractFixture); + expect(await safeProtocolRegistry.supportsInterface("0x00000000")).to.be.false; + + // Generate random interfaceId remove supported interfaceIds + const excludedWords = ["0x01ffc9a7", "0xc23697a8"]; + const randomHexString = + "0x" + + (Math.random().toString(16).slice(2, 10) + "00000000") + .substring(0, 8) + .replace(new RegExp(`(${excludedWords.join("|")})|0x`, "gi"), ""); + + expect(await safeProtocolRegistry.supportsInterface(randomHexString)).to.be.false; }); });