Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipe-rod123 committed Aug 10, 2022
1 parent e37289c commit af8f315
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions apps/meteor/server/methods/roomNameExists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWar
Meteor.methods({
roomNameExists(roomName) {
check(roomName, String);
console.log(`consegui obter o roomName no Meteor Method: ${roomName}`);

methodDeprecationLogger.warn('roomNameExists will be deprecated in future versions of Rocket.Chat');

Expand All @@ -18,17 +17,10 @@ Meteor.methods({
}
const room = Rooms.findOneByName(roomName);

console.log(`Esse é o room no Meteor Method: ${room}`);

let result = true;

if (room === undefined || room === null) {
result = false;
return false;
}

console.log(`Esse é o result no Meteor Method: ${result}`);

return result;
// return !!room;
return true;
},
});
2 changes: 1 addition & 1 deletion apps/meteor/tests/end-to-end/api/09-rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe('[Rooms]', function () {
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('success', true);
expect(res.body.result).to.be.equal(true);
expect(res.body).to.have.property('exists', true);
})
.end(done);
});
Expand Down

0 comments on commit af8f315

Please sign in to comment.