const { expect } = require('chai');
const { ethers } = require('hardhat');
describe('ZKScore Contract Suite', function() {
let identitySBT, scoreCalculator, achievementRegistry;
let owner, user1, user2;
beforeEach(async function() {
[owner, user1, user2] = await ethers.getSigners();
// Deploy contracts
const IdentitySBT = await ethers.getContractFactory('IdentitySBT');
identitySBT = await IdentitySBT.deploy();
const ScoreCalculator = await ethers.getContractFactory('ScoreCalculator');
scoreCalculator = await ScoreCalculator.deploy();
const AchievementRegistry = await ethers.getContractFactory('AchievementRegistry');
achievementRegistry = await AchievementRegistry.deploy();
});
it('Should mint and activate identity', async function() {
await identitySBT.mint(user1.address, 'alice.zks', 'metadata');
await identitySBT.connect(user1).activate(1);
expect(await identitySBT.isActivated(1)).to.equal(true);
});
it('Should calculate score', async function() {
await scoreCalculator.calculateScore(user1.address);
const score = await scoreCalculator.getScore(user1.address);
expect(score).to.be.gte(0);
});
});