UNPKG

thenavisapp

Version:

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

37 lines (27 loc) 1.36 kB
// SPDX-License-Identifier: MIT const { expect } = require("chai"); const NLiquidity = artifacts.require("NLiquidity"); contract("NLiquidity", (accounts) => { let nLiquidityInstance; before(async () => { nLiquidityInstance = await NLiquidity.deployed(); }); it("should deploy NLiquidity contract", async () => { expect(nLiquidityInstance.address).to.exist; }); it("should allow users to add liquidity", async () => { // Assuming you have a function for users to add liquidity await nLiquidityInstance.addLiquidity(1000, { from: accounts[0], value: web3.utils.toWei("1", "ether") }); // Add assertions based on the expected behavior of adding liquidity const userLiquidity = await nLiquidityInstance.getUserLiquidity(accounts[0]); expect(userLiquidity.amount.toNumber()).to.equal(1000); }); it("should allow users to remove liquidity", async () => { // Assuming you have a function for users to remove liquidity await nLiquidityInstance.removeLiquidity(500, { from: accounts[0] }); // Add assertions based on the expected behavior of removing liquidity const userLiquidity = await nLiquidityInstance.getUserLiquidity(accounts[0]); expect(userLiquidity.amount.toNumber()).to.equal(500); }); // Add more tests based on your contract's functionality });