This commit is contained in:
2026-03-07 14:15:48 +03:00
commit 7655b106a7
19 changed files with 12710 additions and 0 deletions

41
tests/Gift.spec.ts Normal file
View 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
});
});