thenavisapp
Version:
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
39 lines (26 loc) • 1.5 kB
JavaScript
// SPDX-License-Identifier: MIT
const { expect } = require("chai");
const NAVISVAULT = artifacts.require("NAVISVAULT");
contract("NAVISVAULT", (accounts) => {
let navisVaultInstance;
before(async () => {
navisVaultInstance = await NAVISVAULT.deployed();
});
it("should deploy NAVISVAULT contract", async () => {
expect(navisVaultInstance.address).to.exist;
});
it("should allow users to deposit and withdraw funds", async () => {
const initialBalance = await web3.eth.getBalance(accounts[0]);
// Deposit some funds into the vault (assuming deposit functionality is implemented)
await navisVaultInstance.deposit({ from: accounts[0], value: web3.utils.toWei("1", "ether") });
const updatedBalanceAfterDeposit = await web3.eth.getBalance(accounts[0]);
// Add assertions based on the expected behavior of depositing funds into the vault
expect(updatedBalanceAfterDeposit).to.be.lessThan(initialBalance);
// Withdraw funds from the vault (assuming withdraw functionality is implemented)
await navisVaultInstance.withdraw(web3.utils.toWei("0.5", "ether"), { from: accounts[0] });
const finalBalanceAfterWithdrawal = await web3.eth.getBalance(accounts[0]);
// Add assertions based on the expected behavior of withdrawing funds from the vault
expect(finalBalanceAfterWithdrawal).to.be.greaterThan(updatedBalanceAfterDeposit);
});
// Add more tests based on your contract's functionality
});