Skip to content

Commit

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

if (user && settings.bio !== undefined && settings.bio !== null) {
if (user && settings.bio != undefined) { // eslint-disable-line
if (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('error-invalid-field');
})
.end(done);
});
Expand Down

0 comments on commit f6ccc36

Please sign in to comment.