git.delta.rocks / unique-network / refs/commits / 70ccc0547051

difftreelog

tests: remove dependency on execution order

Yaroslav Bolyukin2021-02-01parent: #4640cd7.patch.diff
in: master

1 file changed

modifiedtests/src/removeFromWhiteList.test.tsdiffbeforeafterboth
21describe('Integration Test removeFromWhiteList', () => {21describe('Integration Test removeFromWhiteList', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
23 let bob: IKeyringPair;23 let bob: IKeyringPair;
24 let collectionId: number;
2524
26 before(async () => {25 before(async () => {
27 await usingApi(async (api) => {26 await usingApi(async (api) => {
28 alice = privateKey('//Alice');27 alice = privateKey('//Alice');
29 bob = privateKey('//Bob');28 bob = privateKey('//Bob');
30 collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
31 await enableWhiteListExpectSuccess(alice, collectionId);
32 await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
33 });29 });
34 });30 });
3531
36 it('remove bob from whitelist', async () => {32 it('ensure bob is not in whitelist after removal', async () => {
37 await usingApi(async () => {33 await usingApi(async () => {
34 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
35 await enableWhiteListExpectSuccess(alice, collectionId);
36 await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
37
38 await removeFromWhiteListExpectSuccess(alice, collectionId, bob.address);38 await removeFromWhiteListExpectSuccess(alice, collectionId, bob.address);
39 expect(await isWhitelisted(collectionId, bob.address)).to.be.false;
39 });40 });
40 });41 });
41
42 it('ensure bob is no longer in whitelist', async () => {
43 expect(await isWhitelisted(collectionId, bob.address)).to.be.false;
44 });
4542
46 it('allows removal from collection with unset whitelist status', async () => {43 it('allows removal from collection with unset whitelist status', async () => {
47 await usingApi(async () => {44 await usingApi(async () => {