forked from MyZubster-Ecosystem/myzubster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToken.test.js
More file actions
33 lines (28 loc) 路 1.1 KB
/
Copy pathToken.test.js
File metadata and controls
33 lines (28 loc) 路 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const { expect } = require("chai");
describe("MyZubsterToken", function () {
let token;
let owner;
let addr1;
beforeEach(async function () {
const Token = await ethers.getContractFactory("MyZubsterToken");
token = await Token.deploy();
[owner, addr1] = await ethers.getSigners();
});
it("Should deploy and have correct initial supply", async function () {
const totalSupply = await token.totalSupply();
// Usa BigInt per numeri grandi
const expectedSupply = BigInt(1000000000) * BigInt(10) ** BigInt(18);
expect(totalSupply).to.equal(expectedSupply);
});
it("Should allow minting by owner", async function () {
await token.mint(addr1.address, 1000);
const balance = await token.balanceOf(addr1.address);
expect(balance).to.equal(1000);
});
it("Should have correct name and symbol", async function () {
const name = await token.name();
const symbol = await token.symbol();
expect(name).to.equal("MyZubster Token");
expect(symbol).to.equal("MYZ");
});
});