git.delta.rocks / unique-network / refs/commits / 5ec07294ed3b

difftreelog

source

tests/src/rmrk/createBase.test.ts1.9 KiBsourcehistory
1import {getApiConnection} from '../substrate/substrate-api';2import {createCollection, createBase} from './util/tx';34describe('integration test: create new Base', () => {5  let api: any;6  before(async () => { api = await getApiConnection(); });78  const alice = '//Alice';910  it('create empty Base', async () => {11    await createBase(api, alice, 'empty-base-type', 'EBase', []);12  });1314  it('create Base with fixed part', async () => {15    await createBase(api, alice, 'fixedpart-base-type', 'FPBase', [16      {17        'FixedPart': {18          id: 42,19          z: 0,20          src: 'some-fixed-url',21        },22      },23    ]);24  });2526  it('create Base with slot part (no collection)', async () => {27    await createBase(api, alice, 'slotpart-base-type', 'SPBase', [28      {29        'SlotPart': {30          id: 112,31          equippable: 'Empty',32          z: 0,33          src: 'some-fallback-slot-url',34        },35      },36    ]);37  });3839  it('create Base with slot part (any collection)', async () => {40    await createBase(api, alice, 'slotpartany-base-type', 'SPABase', [41      {42        'SlotPart': {43          id: 222,44          equippable: 'All',45          z: 1,46          src: 'some-fallback-slot-url',47        },48      },49    ]);50  });5152  it('create Base with slot part (custom collections)', async () => {53    const firstCollectionId = await createCollection(54      api,55      alice,56      'first-collection-meta',57      null,58      'first-collection',59    );6061    const secondCollectionId = await createCollection(62      api,63      alice,64      'first-collection-meta',65      null,66      'first-collection',67    );6869    await createBase(api, alice, 'slotpartcustom-base-type', 'SPCBase', [70      {71        'SlotPart': {72          id: 1024,73          equippable: {74            'Custom': [firstCollectionId, secondCollectionId],75          },76          z: 2,77          src: 'some-fallback-slot-url',78        },79      },80    ]);81  });8283  after(() => { api.disconnect(); });84});