Skip to content

Commit

Permalink
fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
chrlschwb committed Sep 8, 2023
1 parent 26eb57e commit bdc3c8f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion query-node/mappings/src/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export async function members_MemberProfileUpdated({ store, event }: EventContex
typeof metadata?.validatorAccount === 'string' &&
metadata.validatorAccount !== member.metadata.validatorAccount
) {
member.metadata.validatorAccount = metadata.validatorAccount || undefined
member.metadata.about = (metadata.about || null) as string | undefined
member.metadata.isVerifiedValidator = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export class UpdateProfileHappyCaseFixture extends BaseQueryNodeFixture {
}

public getExpectedValues(): MemberProfileData {
console.log('new value : ', this.newValues)
console.log('old value : ', this.oldValues)
console.log(isSet(this.newValues.validatorAccount), 'name : ', isSet(this.newValues.name))
return {
handle: isSet(this.newValues.handle) ? this.newValues.handle : this.oldValues.handle,
name: isSet(this.newValues.name) ? this.newValues.name || null : this.oldValues.name,
Expand Down Expand Up @@ -99,9 +102,6 @@ export class UpdateProfileHappyCaseFixture extends BaseQueryNodeFixture {
expected.externalResources?.map(asMembershipExternalResource) ?? []
)
assert.isFalse(Utils.hasDuplicates(newMetadata.externalResources?.map(({ type }) => type)))
// assert.equal(newMetadata.isVerifiedValidator, false);
// console.log(newMetadata, expected);
// assert.equal(newMetadata.validatorAccount, expected.validatorAccount);
}

async execute(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion tests/network-tests/src/fixtures/membership/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type MemberCreationParams = {
metadata: Bytes
is_founding_member: boolean
isVerifiedValidator?: boolean
validatorAccount?: string | null
validatorAccount?: string
}

// Common code for Membership fixtures
Expand Down
4 changes: 2 additions & 2 deletions tests/network-tests/src/flows/membership/updatingProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function updatingProfile({ api, query }: FlowProps): Promis
value: '[email protected]',
},
],
validatorAccount: 'validator address2',
validatorAccount: '',
},
// Full update
{
Expand All @@ -57,7 +57,6 @@ export default async function updatingProfile({ api, query }: FlowProps): Promis
value: 'example.com',
},
],
validatorAccount: '',
},
]

Expand All @@ -70,6 +69,7 @@ export default async function updatingProfile({ api, query }: FlowProps): Promis
for (const newValues of updates) {
const context = { account, memberId }
const updateProfileHappyCaseFixture = new UpdateProfileHappyCaseFixture(api, query, context, oldValues, newValues)

await new FixtureRunner(updateProfileHappyCaseFixture).runWithQueryNodeChecks()
oldValues = updateProfileHappyCaseFixture.getExpectedValues()
}
Expand Down

0 comments on commit bdc3c8f

Please sign in to comment.