PLT-5109/PLT-5112 Fixed commented out unit tests (#4951)

* Removed note about unconfirmed race condition

* Fixed unit tests in client_channel.test.jsx

* Fixed updateActive unit test on client
This commit is contained in:
Harrison Healey
2017-01-04 09:30:14 -05:00
committed by Corey Hulen
parent c0a5f9fbef
commit 63d2851ec7
3 changed files with 16 additions and 35 deletions

View File

@@ -136,7 +136,6 @@ function populateDMChannelsWithProfiles(userIds) {
const currentUserId = UserStore.getCurrentId(); const currentUserId = UserStore.getCurrentId();
for (let i = 0; i < userIds.length; i++) { for (let i = 0; i < userIds.length; i++) {
// TODO There's a race condition here for DM channels if those channels aren't loaded yet
const channelName = getDirectChannelName(currentUserId, userIds[i]); const channelName = getDirectChannelName(currentUserId, userIds[i]);
const channel = ChannelStore.getByName(channelName); const channel = ChannelStore.getByName(channelName);
if (channel) { if (channel) {

View File

@@ -25,25 +25,16 @@ describe('Client.Channels', function() {
}); });
}); });
/* TODO: FIX THIS TEST
it('createDirectChannel', function(done) { it('createDirectChannel', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {
TestHelper.basicClient().createUser( TestHelper.basicClient().createUser(
TestHelper.fakeUser(), TestHelper.fakeUser(),
function(user2) { function(user2) {
TestHelper.basicClient().addUserToTeam( TestHelper.basicClient().createDirectChannel(
user2.id, user2.id,
function() { function(data) {
TestHelper.basicClient().createDirectChannel( assert.equal(data.id.length > 0, true);
user2.id, done();
function(data) {
assert.equal(data.id.length > 0, true);
done();
},
function(err) {
done(new Error(err.message));
}
);
}, },
function(err) { function(err) {
done(new Error(err.message)); done(new Error(err.message));
@@ -56,7 +47,6 @@ describe('Client.Channels', function() {
); );
}); });
}); });
*/
it('updateChannel', function(done) { it('updateChannel', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {
@@ -394,26 +384,20 @@ describe('Client.Channels', function() {
}); });
}); });
/* TODO FIX THIS TEST
it('addChannelMember', function(done) { it('addChannelMember', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {
TestHelper.basicClient().createUser( TestHelper.basicClient().createUserWithInvite(
TestHelper.fakeUser(), TestHelper.fakeUser(),
null,
null,
TestHelper.basicTeam().invite_id,
function(user2) { function(user2) {
TestHelper.basicClient().addUserToTeam( TestHelper.basicClient().addChannelMember(
TestHelper.basicChannel().id,
user2.id, user2.id,
function() { function(data) {
TestHelper.basicClient().addChannelMember( assert.equal(data.channel_id.length > 0, true);
TestHelper.basicChannel().id, done();
user2.id,
function(data) {
assert.equal(data.channel_id.length > 0, true);
done();
},
function(err) {
done(new Error(err.message));
}
);
}, },
function(err) { function(err) {
done(new Error(err.message)); done(new Error(err.message));
@@ -426,7 +410,6 @@ describe('Client.Channels', function() {
); );
}); });
}); });
*/
it('removeChannelMember', function(done) { it('removeChannelMember', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {

View File

@@ -258,16 +258,15 @@ describe('Client.User', function() {
}); });
}); });
/* TODO: FIX THIS TEST
it('updateActive', function(done) { it('updateActive', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {
var user = TestHelper.basicUser(); const user = TestHelper.basicUser();
TestHelper.basicClient().updateActive( TestHelper.basicClient().updateActive(
user.id, user.id,
false, false,
function(data) { function(data) {
assert.equal(data.last_activity_at > 0, true); assert.ok(data.delete_at > 0);
done(); done();
}, },
function(err) { function(err) {
@@ -275,7 +274,7 @@ describe('Client.User', function() {
} }
); );
}); });
});*/ });
it('sendPasswordReset', function(done) { it('sendPasswordReset', function(done) {
TestHelper.initBasic(() => { TestHelper.initBasic(() => {