|
@@ -1,14 +1,12 @@
|
|
import { BaseFixture } from '../Fixture'
|
|
import { BaseFixture } from '../Fixture'
|
|
import { Api } from '../Api'
|
|
import { Api } from '../Api'
|
|
-// import { MemberId } from '@joystream/types/members'
|
|
|
|
import { ChannelId } from '@joystream/types/common'
|
|
import { ChannelId } from '@joystream/types/common'
|
|
-import { assert } from 'chai'
|
|
|
|
|
|
|
|
export class CreateChannelsAsMemberFixture extends BaseFixture {
|
|
export class CreateChannelsAsMemberFixture extends BaseFixture {
|
|
// Member that will be channel owner
|
|
// Member that will be channel owner
|
|
private memberId: number
|
|
private memberId: number
|
|
private numChannels: number
|
|
private numChannels: number
|
|
- private createdChannels: (ChannelId | null)[] = []
|
|
|
|
|
|
+ private createdChannels: ChannelId[] = []
|
|
|
|
|
|
constructor(api: Api, memberId: number, numChannels: number) {
|
|
constructor(api: Api, memberId: number, numChannels: number) {
|
|
super(api)
|
|
super(api)
|
|
@@ -16,7 +14,7 @@ export class CreateChannelsAsMemberFixture extends BaseFixture {
|
|
this.numChannels = numChannels
|
|
this.numChannels = numChannels
|
|
}
|
|
}
|
|
|
|
|
|
- public getCreatedChannels(): (ChannelId | null)[] {
|
|
|
|
|
|
+ public getCreatedChannels(): ChannelId[] {
|
|
return this.createdChannels.slice()
|
|
return this.createdChannels.slice()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -28,9 +26,6 @@ export class CreateChannelsAsMemberFixture extends BaseFixture {
|
|
channels.push(this.api.createMockChannel(this.memberId, account))
|
|
channels.push(this.api.createMockChannel(this.memberId, account))
|
|
}
|
|
}
|
|
|
|
|
|
- const channelIds = await Promise.all(channels)
|
|
|
|
- this.createdChannels = channelIds.filter((id) => id !== null)
|
|
|
|
-
|
|
|
|
- assert.equal(this.createdChannels.length, this.numChannels)
|
|
|
|
|
|
+ this.createdChannels = await Promise.all(channels)
|
|
}
|
|
}
|
|
}
|
|
}
|