From cad3644e514cf8b47f68252f1f96c7899c47efbf Mon Sep 17 00:00:00 2001
From: Dhruv-Varshney-developer <dhruvvarshney77@gmail.com>
Date: Thu, 9 Jan 2025 22:19:18 +0530
Subject: [PATCH] improve(test): Added tests for Boba_SpokePool.sol

Signed-off-by: Dhruv-Varshney-developer <dhruvvarshney77@gmail.com>
---
 .../Boba_SpokePool.ts                         | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 test/evm/hardhat/chain-specific-spokepools/Boba_SpokePool.ts

diff --git a/test/evm/hardhat/chain-specific-spokepools/Boba_SpokePool.ts b/test/evm/hardhat/chain-specific-spokepools/Boba_SpokePool.ts
new file mode 100644
index 000000000..e7db96875
--- /dev/null
+++ b/test/evm/hardhat/chain-specific-spokepools/Boba_SpokePool.ts
@@ -0,0 +1,44 @@
+import { ethers, expect, Contract, SignerWithAddress, getContractFactory } from "../../../../utils/utils";
+import { hre } from "../../../../utils/utils.hre";
+import { hubPoolFixture } from "../fixtures/HubPool.Fixture";
+
+describe("Boba Spoke Pool", function () {
+  let hubPool: Contract, spokePool: Contract, weth: Contract;
+  let owner: SignerWithAddress;
+
+  beforeEach(async function () {
+    [owner] = await ethers.getSigners();
+    ({ weth, hubPool } = await hubPoolFixture());
+
+    // Deploy spoke pool
+    spokePool = await hre.upgrades.deployProxy(
+      await getContractFactory("Boba_SpokePool", owner),
+      [0, owner.address, hubPool.address],
+      {
+        kind: "uups",
+        unsafeAllow: ["delegatecall"],
+        constructorArgs: [weth.address, 60 * 60, 9 * 60 * 60],
+      }
+    );
+  });
+
+  describe("Initialization", function () {
+    it("Should initialize with correct constructor parameters", async function () {
+      expect(await spokePool.wrappedNativeToken()).to.equal(weth.address);
+    });
+
+    it("Should initialize with correct proxy parameters", async function () {
+      expect(await spokePool.numberOfDeposits()).to.equal(0);
+      expect(await spokePool.crossDomainAdmin()).to.equal(owner.address);
+      expect(await spokePool.withdrawalRecipient()).to.equal(hubPool.address);
+    });
+
+    it("Should initialize with correct L2_ETH", async function () {
+      expect(await spokePool.l2Eth()).to.equal("0x4200000000000000000000000000000000000006");
+    });
+
+    it("Should revert on reinitialization", async function () {
+      await expect(spokePool.connect(owner).initialize(0, owner.address, hubPool.address)).to.be.reverted;
+    });
+  });
+});