init
This commit is contained in:
41
tests/Gift.spec.ts
Normal file
41
tests/Gift.spec.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Blockchain, SandboxContract, TreasuryContract } from '@ton/sandbox';
|
||||
import { toNano } from '@ton/core';
|
||||
import { Gift } from '../build/Gift/Gift_Gift';
|
||||
import '@ton/test-utils';
|
||||
|
||||
describe('Gift', () => {
|
||||
let blockchain: Blockchain;
|
||||
let deployer: SandboxContract<TreasuryContract>;
|
||||
let gift: SandboxContract<Gift>;
|
||||
|
||||
beforeEach(async () => {
|
||||
blockchain = await Blockchain.create();
|
||||
|
||||
deployer = await blockchain.treasury('deployer');
|
||||
|
||||
const content = { $$type: 'Content' as const, content: 'test', imageUrl: null };
|
||||
const receiver = deployer.address;
|
||||
|
||||
gift = blockchain.openContract(await Gift.fromInit(content, receiver));
|
||||
|
||||
const deployResult = await gift.send(
|
||||
deployer.getSender(),
|
||||
{
|
||||
value: toNano('0.05'),
|
||||
},
|
||||
null,
|
||||
);
|
||||
|
||||
expect(deployResult.transactions).toHaveTransaction({
|
||||
from: deployer.address,
|
||||
to: gift.address,
|
||||
deploy: true,
|
||||
success: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('should deploy', async () => {
|
||||
// the check is done inside beforeEach
|
||||
// blockchain and gift are ready to use
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user