difftreelog
Merge pull request #51 from usetech-llc/feature/NFTPAR-246_remove_sponsor_tests
in: master
NFTPAR-246 remove sponsor tests
3 files changed
tests/src/confirmSponsorship.test.tsdiffbeforeafterboth32let bob: IKeyringPair;32let bob: IKeyringPair;33let charlie: IKeyringPair;33let charlie: IKeyringPair;343435describe.only('integration test: ext. confirmSponsorship():', () => {35describe('integration test: ext. confirmSponsorship():', () => {363637 before(async () => {37 before(async () => {38 await usingApi(async (api) => {38 await usingApi(async (api) => {299299300});300});301301302describe.only('(!negative test!) integration test: ext. setCollectionSponsor():', () => {302describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {303 before(async () => {303 before(async () => {304 await usingApi(async (api) => {304 await usingApi(async (api) => {305 const keyring = new Keyring({ type: 'sr25519' });305 const keyring = new Keyring({ type: 'sr25519' });tests/src/removeCollectionSponsor.test.tsdiffbeforeafterbothno changes
tests/src/util/helpers.tsdiffbeforeafterboth213 });213 });214}214}215216export async function removeCollectionSponsorExpectSuccess(collectionId: number) {217 await usingApi(async (api) => {218219 // Run the transaction220 const alicePrivateKey = privateKey('//Alice');221 const tx = api.tx.nft.removeCollectionSponsor(collectionId);222 const events = await submitTransactionAsync(alicePrivateKey, tx);223 const result = getGenericResult(events);224225 // Get the collection 226 const collection: any = (await api.query.nft.collection(collectionId)).toJSON();227228 // What to expect229 expect(result.success).to.be.true;230 expect(collection.Sponsor).to.be.equal(nullPublicKey);231 expect(collection.SponsorConfirmed).to.be.false;232 });233}234235export async function removeCollectionSponsorExpectFailure(collectionId: number) {236 await usingApi(async (api) => {237238 // Run the transaction239 const alicePrivateKey = privateKey('//Alice');240 const tx = api.tx.nft.removeCollectionSponsor(collectionId);241 const events = await submitTransactionAsync(alicePrivateKey, tx);242 const result = getGenericResult(events);243244 // What to expect245 expect(result.success).to.be.false;246 });247}215248216export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed: string = '//Alice') {249export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed: string = '//Alice') {217 await usingApi(async (api) => {250 await usingApi(async (api) => {