Skip to content

Commit

Permalink
fix: should fix the failing api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Curious-Goblin committed Jan 9, 2025
1 parent b1d17d2 commit 9b8785e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/server/methods/saveUserProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ async function saveUserProfile(
await setUserStatusMethod(this.userId, settings.statusType as UserStatus, undefined);
}

if (user && settings.bio !== undefined && settings.bio !== null) {
if (typeof settings.bio !== 'string') {
if (user && settings.bio !== undefined) {
if (settings.bio === null || typeof settings.bio !== 'string') {
throw new Meteor.Error('error-invalid-field', 'bio', {
method: 'saveUserProfile',
});
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/end-to-end/api/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4571,7 +4571,7 @@ describe('[Users]', () => {
.expect(400)
.expect((res) => {
expect(res.body).to.have.property('success', false);
expect(res.body.error).to.include('invalid bio');
expect(res.body.error).to.include('bio must be a string');
})
.end(done);
});
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9312,6 +9312,7 @@ __metadata:
adm-zip: "npm:0.5.16"
ajv: "npm:^8.17.1"
ajv-formats: "npm:~3.0.1"
ansi-colors: "npm:^4.1.3"
apn: "npm:2.2.0"
archiver: "npm:^7.0.1"
asterisk-manager: "npm:^0.2.0"
Expand Down

0 comments on commit 9b8785e

Please sign in to comment.