git.delta.rocks / unique-network / refs/commits / bab6ffec254b

difftreelog

source

tests/src/createItem.test.ts1.5 KiBsourcehistory
1//
2// This file is subject to the terms and conditions defined in
3// file 'LICENSE', which is part of this source code package.
4//
5
6import { default as usingApi } from './substrate/substrate-api';
7import { Keyring } from "@polkadot/api";
8import { IKeyringPair } from "@polkadot/types/types";
9import { 
10  createCollectionExpectSuccess, 
11  createItemExpectSuccess
12} from './util/helpers';
13
14let alice: IKeyringPair;
15
16describe('integration test: ext. createItem():', () => {
17  before(async () => {
18    await usingApi(async (api) => {
19      const keyring = new Keyring({ type: 'sr25519' });
20      alice = keyring.addFromUri(`//Alice`);
21    });
22  });
23
24  it('Create new item in NFT collection', async () => {
25    const createMode = 'NFT';
26    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
27    await createItemExpectSuccess(alice, newCollectionID, createMode);
28  });
29  it('Create new item in Fungible collection', async () => {
30    const createMode = 'Fungible';
31    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
32    await createItemExpectSuccess(alice, newCollectionID, createMode);
33  });
34  it('Create new item in ReFungible collection', async () => {
35    const createMode = 'ReFungible';
36    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
37    await createItemExpectSuccess(alice, newCollectionID, createMode);
38  });
39});