From 9d4019618d0a1b2b033d5633c558561d6a61fa8c Mon Sep 17 00:00:00 2001 From: Damjan Dimitrov Date: Fri, 19 Jan 2024 11:16:38 +0100 Subject: [PATCH] Update unit tests --- packages/sdk/src/tests/hosting.test.ts | 5 ++++- packages/sdk/src/tests/identity.test.ts | 3 ++- packages/sdk/src/tests/nft.test.ts | 12 +++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/sdk/src/tests/hosting.test.ts b/packages/sdk/src/tests/hosting.test.ts index 80a374c..4787af7 100644 --- a/packages/sdk/src/tests/hosting.test.ts +++ b/packages/sdk/src/tests/hosting.test.ts @@ -1,6 +1,6 @@ import { resolve } from 'path'; import { Hosting } from '../modules/hosting/hosting'; -import { DeployToEnvironment } from '../types/hosting'; +import { DeployToEnvironment, DeploymentStatus } from '../types/hosting'; import { getConfig, getWebsiteUUID } from './helpers/helper'; import { HostingWebsite } from '../modules/hosting/hosting-website'; import * as fs from 'fs'; @@ -37,6 +37,9 @@ describe('Hosting tests', () => { const deployment = await website.deploy(DeployToEnvironment.TO_STAGING); expect(deployment.environment).toEqual(DeployToEnvironment.TO_STAGING); deploymentUuid = deployment.uuid; + + await website.get(); + expect(website.lastDeploymentStatus).toEqual(DeploymentStatus.INITIATED); }); test.skip('upload files from buffer', async () => { diff --git a/packages/sdk/src/tests/identity.test.ts b/packages/sdk/src/tests/identity.test.ts index 3d2add3..a25618a 100644 --- a/packages/sdk/src/tests/identity.test.ts +++ b/packages/sdk/src/tests/identity.test.ts @@ -158,7 +158,8 @@ describe('Identity Module tests', () => { '3rJriA6MiYj7oFXv5hgxvSuacenm8fk76Kb5TEEHcWWQVvii', ); expect(subsocial.content.name).toBe('dev only'); - expect(subsocial.content.interests).toContain('crypto'); + expect(subsocial.content.summary).toBeDefined(); + expect(subsocial.content.about).toBeDefined(); const { polkadot } = await identity.getWalletIdentity( '5HqHQDGcHqSQELAyr5PbJNAcQJew4vsoNCf5kkSpXcUGMtCK', diff --git a/packages/sdk/src/tests/nft.test.ts b/packages/sdk/src/tests/nft.test.ts index 8657ed2..16f300b 100644 --- a/packages/sdk/src/tests/nft.test.ts +++ b/packages/sdk/src/tests/nft.test.ts @@ -24,8 +24,9 @@ describe('Nft tests', () => { const collection = await nft.create({ chain: EvmChain.MOONBASE, collectionType: CollectionType.GENERIC, - name: 'created from sdk tests', - symbol: 'cfst', + name: 'sdk test', + description: 'created from sdk tests', + symbol: 'sdkt', royaltiesFees: 0, royaltiesAddress: '0x0000000000000000000000000000000000000000', baseUri: 'https://test.com/metadata/', @@ -36,6 +37,11 @@ describe('Nft tests', () => { drop: false, }); expect(collection.uuid).toBeDefined(); + expect(collection.contractAddress).toBeDefined(); + expect(collection.symbol).toEqual('sdkt'); + expect(collection.name).toEqual('sdk test'); + expect(collection.description).toEqual('created from sdk tests'); + collectionUuid = collection.uuid; }); @@ -56,7 +62,7 @@ describe('Nft tests', () => { test('get nft collection details', async () => { const collection = await nft.collection(collectionUuid).get(); console.log(collection); - expect(collection.name).toBe('created from sdk tests'); + expect(collection.name).toBe('sdk test'); }); test('should fail nest minting for collection that is not nestable if collection populated', async () => {