git.delta.rocks / unique-network / refs/commits / 5259d552fbda

difftreelog

Missing tests added

str-mv2021-08-13parent: #d8afbf6.patch.diff
in: master

1 file changed

modifiedtests/src/mintModes.test.tsdiffbeforeafterboth
17 disableWhiteListExpectSuccess,17 disableWhiteListExpectSuccess,
18} from './util/helpers';18} from './util/helpers';
1919
20describe('Integration Test public minting', () => {20describe.only('Integration Test public minting', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
22 let bob: IKeyringPair;22 let bob: IKeyringPair;
2323
28 });28 });
29 });29 });
3030
31 it('If the public minting mode is enabled and the whitelist mode is enabled, then the address added to the whitelist and not the owner or administrator can create tokens', async () => {31 it('If the whitelist mode is enabled, then the address added to the whitelist and not the owner or administrator can create tokens', async () => {
32 await usingApi(async () => {32 await usingApi(async () => {
33 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });33 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
34 await enableWhiteListExpectSuccess(alice, collectionId);34 await enableWhiteListExpectSuccess(alice, collectionId);
39 });39 });
40 });40 });
4141
42 it('Public minting mode is disabled then the address that is user cannot create tokens', async () => {42 it('If the whitelist mode is enabled, address not included in whitelist that is user cannot create tokens', async () => {
43 await usingApi(async () => {43 await usingApi(async () => {
44 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });44 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
45 await disableWhiteListExpectSuccess(alice, collectionId);45 await enableWhiteListExpectSuccess(alice, collectionId);
46 await setMintPermissionExpectSuccess(alice, collectionId, false);46 await setMintPermissionExpectSuccess(alice, collectionId, true);
47 await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
48 await createItemExpectFailure(bob, collectionId, 'NFT');47 await createItemExpectFailure(bob, collectionId, 'NFT');
49 });48 });
50 });49 });
5150
52 it('Public minting mode is disabled then the address that is admin can create tokens', async () => {51 it('If the whitelist mode is enabled, address not included in whitelist that is admin can create tokens', async () => {
53 await usingApi(async () => {52 await usingApi(async () => {
54 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });53 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
55 await disableWhiteListExpectSuccess(alice, collectionId);54 await enableWhiteListExpectSuccess(alice, collectionId);
56 await setMintPermissionExpectSuccess(alice, collectionId, false);55 await setMintPermissionExpectSuccess(alice, collectionId, true);
57 await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
58 await addCollectionAdminExpectSuccess(alice, collectionId, bob);56 await addCollectionAdminExpectSuccess(alice, collectionId, bob);
59 await createItemExpectSuccess(bob, collectionId, 'NFT');57 await createItemExpectSuccess(bob, collectionId, 'NFT');
60 });58 });
61 });59 });
6260
63 it('Public minting mode is disabled then the address that is collection owner can create tokens', async () => {61 it('If the whitelist mode is enabled, address not included in whitelist that is owner can create tokens', async () => {
64 await usingApi(async () => {62 await usingApi(async () => {
65 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });63 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
66 await disableWhiteListExpectSuccess(alice, collectionId);64 await enableWhiteListExpectSuccess(alice, collectionId);
67 await setMintPermissionExpectSuccess(alice, collectionId, false);65 await setMintPermissionExpectSuccess(alice, collectionId, true);
68 await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
69 await createItemExpectSuccess(alice, collectionId, 'NFT');66 await createItemExpectSuccess(alice, collectionId, 'NFT');
70 });67 });
71 });68 });
72
7369
74 it('Public minting mode is enabled and address not included in whitelist that is user cannot create tokens', async () => {70 it('If the whitelist mode is disabled, owner can create tokens', async () => {
75 await usingApi(async () => {71 await usingApi(async () => {
76 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });72 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
77 await enableWhiteListExpectSuccess(alice, collectionId);73 await disableWhiteListExpectSuccess(alice, collectionId);
78 await setMintPermissionExpectSuccess(alice, collectionId, true);74 await setMintPermissionExpectSuccess(alice, collectionId, true);
79 await createItemExpectFailure(bob, collectionId, 'NFT');75 await createItemExpectSuccess(alice, collectionId, 'NFT');
80 });76 });
81 });77 });
8278
83 it('Public minting mode is enabled and address not included in whitelist that is admin can create tokens', async () => {79 it('If the whitelist mode is disabled, collection admin can create tokens', async () => {
84 await usingApi(async () => {80 await usingApi(async () => {
85 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });81 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
86 await enableWhiteListExpectSuccess(alice, collectionId);82 await disableWhiteListExpectSuccess(alice, collectionId);
87 await setMintPermissionExpectSuccess(alice, collectionId, true);83 await setMintPermissionExpectSuccess(alice, collectionId, true);
88 await addCollectionAdminExpectSuccess(alice, collectionId, bob);84 await addCollectionAdminExpectSuccess(alice, collectionId, bob);
89 await createItemExpectSuccess(bob, collectionId, 'NFT');85 await createItemExpectSuccess(bob, collectionId, 'NFT');
90 });86 });
91 });87 });
9288
93 it('Public minting mode is enabled and address not included in whitelist that is owner can create tokens', async () => {89 it('If the whitelist mode is disabled, regular user can`t create tokens', async () => {
94 await usingApi(async () => {90 await usingApi(async () => {
95 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });91 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
96 await enableWhiteListExpectSuccess(alice, collectionId);92 await disableWhiteListExpectSuccess(alice, collectionId);
97 await setMintPermissionExpectSuccess(alice, collectionId, true);93 await setMintPermissionExpectSuccess(alice, collectionId, true);
98 await createItemExpectSuccess(alice, collectionId, 'NFT');94 await createItemExpectFailure(bob, collectionId, 'NFT');
99 });95 });
100 });96 });
101
102});97});
10398
104describe('Integration Test private minting', () => {99describe.only('Integration Test private minting', () => {
105 let alice: IKeyringPair;100 let alice: IKeyringPair;
106 let bob: IKeyringPair;101 let bob: IKeyringPair;
107102
112 });107 });
113 });108 });
114109
115 it('If the private minting mode is enabled then the address that is the owner or admin cannot create tokens', async () => {110 it('Address that is the not owner or not admin cannot create tokens', async () => {
116 await usingApi(async () => {111 await usingApi(async () => {
117 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });112 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
118 await enableWhiteListExpectSuccess(alice, collectionId);113 await enableWhiteListExpectSuccess(alice, collectionId);
123 });117 });
124 });118 });
125119
120 it('Address that is collection owner can create tokens', async () => {
121 await usingApi(async () => {
122 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
123 await disableWhiteListExpectSuccess(alice, collectionId);
124 await setMintPermissionExpectSuccess(alice, collectionId, false);
125 //await addCollectionAdminExpectSuccess(alice, collectionId, bob);
126 await createItemExpectSuccess(alice, collectionId, 'NFT');
127 });
128 });
129
130 it('Address that is user cannot create tokens', async () => {
131 await usingApi(async () => {
132 const collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
133 await disableWhiteListExpectSuccess(alice, collectionId);
134 await setMintPermissionExpectSuccess(alice, collectionId, false);
135 // await addToWhiteListExpectSuccess(alice, collectionId, bob.address);
136 await createItemExpectFailure(bob, collectionId, 'NFT');
137 });
138 });
126});139});
127140