Browse Source

Query node & cont dir inegration tests: fix assertion

iorveth 4 years ago
parent
commit
7ee9748b3d

+ 0 - 5
tests/network-tests/src/Api.ts

@@ -2084,11 +2084,6 @@ export class QueryNodeApi extends Api {
           item {
             ... on Video {
               title
-              description
-              duration
-              thumbnailUrl
-              isExplicit
-              isPublic
             }
           }
         }

+ 1 - 2
tests/network-tests/src/flows/contentDirectory/contentDirectoryInitialization.ts

@@ -1,5 +1,4 @@
-import { Api, WorkingGroups } from '../../Api'
-import { assert } from 'chai'
+import { Api } from '../../Api'
 import { KeyringPair } from '@polkadot/keyring/types'
 
 export default async function initializeContentDirectory(api: Api, leadKeyPair: KeyringPair) {

+ 5 - 5
tests/network-tests/src/flows/contentDirectory/creatingChannel.ts

@@ -20,11 +20,11 @@ export function createSimpleChannelFixture(api: QueryNodeApi): CreateChannelFixt
 }
 
 function assertChannelMatchQueriedResult(queriedChannel: any, channel: ChannelEntity) {
-  assert(queriedChannel.handle === channel.handle, 'Should be equal')
-  assert(queriedChannel.description === channel.description, 'Should be equal')
-  assert(queriedChannel.coverPhotoUrl === channel.coverPhotoUrl, 'Should be equal')
-  assert(queriedChannel.avatarPhotoUrl === channel.avatarPhotoUrl, 'Should be equal')
-  assert(queriedChannel.isPublic === channel.isPublic, 'Should be equal')
+  assert.equal(queriedChannel.handle, channel.handle, 'Should be equal')
+  assert.equal(queriedChannel.description, channel.description, 'Should be equal')
+  assert.equal(queriedChannel.coverPhotoUrl, channel.coverPhotoUrl, 'Should be equal')
+  assert.equal(queriedChannel.avatarPhotoUrl, channel.avatarPhotoUrl, 'Should be equal')
+  assert.equal(queriedChannel.isPublic, channel.isPublic, 'Should be equal')
 }
 
 export default async function channelCreation(api: QueryNodeApi) {

+ 7 - 7
tests/network-tests/src/flows/contentDirectory/creatingVideo.ts

@@ -1,4 +1,4 @@
-import { QueryNodeApi, WorkingGroups } from '../../Api'
+import { QueryNodeApi } from '../../Api'
 import { CreateVideoFixture } from '../../fixtures/contentDirectoryModule'
 import { VideoEntity } from '@joystream/cd-schemas/types/entities/VideoEntity'
 import { assert } from 'chai'
@@ -44,12 +44,12 @@ export function createVideoReferencingChannelFixture(api: QueryNodeApi, handle:
 }
 
 function assertVideoMatchQueriedResult(queriedVideo: any, video: VideoEntity) {
-  assert(queriedVideo.title === video.title, 'Should be equal')
-  assert(queriedVideo.description === video.description, 'Should be equal')
-  assert(queriedVideo.duration === video.duration, 'Should be equal')
-  assert(queriedVideo.thumbnailUrl === video.thumbnailUrl, 'Should be equal')
-  assert(queriedVideo.isExplicit === video.isExplicit, 'Should be equal')
-  assert(queriedVideo.isPublic === video.isPublic, 'Should be equal')
+  assert.equal(queriedVideo.title, video.title, 'Should be equal')
+  assert.equal(queriedVideo.description, video.description, 'Should be equal')
+  assert.equal(queriedVideo.duration, video.duration, 'Should be equal')
+  assert.equal(queriedVideo.thumbnailUrl, video.thumbnailUrl, 'Should be equal')
+  assert.equal(queriedVideo.isExplicit, video.isExplicit, 'Should be equal')
+  assert.equal(queriedVideo.isPublic, video.isPublic, 'Should be equal')
 }
 
 export default async function createVideo(api: QueryNodeApi) {

+ 6 - 6
tests/network-tests/src/flows/contentDirectory/updatingChannel.ts

@@ -1,4 +1,4 @@
-import { QueryNodeApi, WorkingGroups } from '../../Api'
+import { QueryNodeApi } from '../../Api'
 import { UpdateChannelFixture } from '../../fixtures/contentDirectoryModule'
 import { ChannelEntity } from '@joystream/cd-schemas/types/entities/ChannelEntity'
 import { assert } from 'chai'
@@ -36,10 +36,10 @@ export default async function updateChannel(api: QueryNodeApi) {
   const channelAfterUpdate = channelAfterUpdateResult.data.channels[0]
 
   // description field should be updated to provided one
-  assert(channelAfterUpdate.description === description, 'Should be equal')
+  assert.equal(channelAfterUpdate.description, description, 'Should be equal')
 
-  assert(channelAfterUpdate.handle === channel.handle, 'Should be equal')
-  assert(channelAfterUpdate.coverPhotoUrl === channel.coverPhotoUrl, 'Should be equal')
-  assert(channelAfterUpdate.avatarPhotoUrl === channel.avatarPhotoUrl, 'Should be equal')
-  assert(channelAfterUpdate.isPublic === channel.isPublic, 'Should be equal')
+  assert.equal(channelAfterUpdate.handle, channel.handle, 'Should be equal')
+  assert.equal(channelAfterUpdate.coverPhotoUrl, channel.coverPhotoUrl, 'Should be equal')
+  assert.equal(channelAfterUpdate.avatarPhotoUrl, channel.avatarPhotoUrl, 'Should be equal')
+  assert.equal(channelAfterUpdate.isPublic, channel.isPublic, 'Should be equal')
 }