summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-01-04 09:30:14 -0500
committerCorey Hulen <corey@hulen.com>2017-01-04 09:30:14 -0500
commit63d2851ec7cffe4c3ac2bdedfbfebd87f3053676 (patch)
treeca5f5cc898b0f7f8b3ab615706a43bc3e72eda84 /webapp
parentc0a5f9fbef710173b6b8933252cc97fe1109c09b (diff)
downloadchat-63d2851ec7cffe4c3ac2bdedfbfebd87f3053676.tar.gz
chat-63d2851ec7cffe4c3ac2bdedfbfebd87f3053676.tar.bz2
chat-63d2851ec7cffe4c3ac2bdedfbfebd87f3053676.zip
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
Diffstat (limited to 'webapp')
-rw-r--r--webapp/actions/user_actions.jsx1
-rw-r--r--webapp/tests/client_channel.test.jsx43
-rw-r--r--webapp/tests/client_user.test.jsx7
3 files changed, 16 insertions, 35 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index b666413d9..15626db2b 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -136,7 +136,6 @@ function populateDMChannelsWithProfiles(userIds) {
const currentUserId = UserStore.getCurrentId();
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 channel = ChannelStore.getByName(channelName);
if (channel) {
diff --git a/webapp/tests/client_channel.test.jsx b/webapp/tests/client_channel.test.jsx
index 77f9f9653..02d014a1f 100644
--- a/webapp/tests/client_channel.test.jsx
+++ b/webapp/tests/client_channel.test.jsx
@@ -25,25 +25,16 @@ describe('Client.Channels', function() {
});
});
- /* TODO: FIX THIS TEST
it('createDirectChannel', function(done) {
TestHelper.initBasic(() => {
TestHelper.basicClient().createUser(
TestHelper.fakeUser(),
function(user2) {
- TestHelper.basicClient().addUserToTeam(
+ TestHelper.basicClient().createDirectChannel(
user2.id,
- function() {
- TestHelper.basicClient().createDirectChannel(
- user2.id,
- function(data) {
- assert.equal(data.id.length > 0, true);
- done();
- },
- function(err) {
- done(new Error(err.message));
- }
- );
+ function(data) {
+ assert.equal(data.id.length > 0, true);
+ done();
},
function(err) {
done(new Error(err.message));
@@ -56,7 +47,6 @@ describe('Client.Channels', function() {
);
});
});
- */
it('updateChannel', function(done) {
TestHelper.initBasic(() => {
@@ -394,26 +384,20 @@ describe('Client.Channels', function() {
});
});
- /* TODO FIX THIS TEST
it('addChannelMember', function(done) {
TestHelper.initBasic(() => {
- TestHelper.basicClient().createUser(
+ TestHelper.basicClient().createUserWithInvite(
TestHelper.fakeUser(),
+ null,
+ null,
+ TestHelper.basicTeam().invite_id,
function(user2) {
- TestHelper.basicClient().addUserToTeam(
+ TestHelper.basicClient().addChannelMember(
+ TestHelper.basicChannel().id,
user2.id,
- function() {
- TestHelper.basicClient().addChannelMember(
- TestHelper.basicChannel().id,
- user2.id,
- function(data) {
- assert.equal(data.channel_id.length > 0, true);
- done();
- },
- function(err) {
- done(new Error(err.message));
- }
- );
+ function(data) {
+ assert.equal(data.channel_id.length > 0, true);
+ done();
},
function(err) {
done(new Error(err.message));
@@ -426,7 +410,6 @@ describe('Client.Channels', function() {
);
});
});
- */
it('removeChannelMember', function(done) {
TestHelper.initBasic(() => {
diff --git a/webapp/tests/client_user.test.jsx b/webapp/tests/client_user.test.jsx
index 741f494bb..643640b59 100644
--- a/webapp/tests/client_user.test.jsx
+++ b/webapp/tests/client_user.test.jsx
@@ -258,16 +258,15 @@ describe('Client.User', function() {
});
});
- /* TODO: FIX THIS TEST
it('updateActive', function(done) {
TestHelper.initBasic(() => {
- var user = TestHelper.basicUser();
+ const user = TestHelper.basicUser();
TestHelper.basicClient().updateActive(
user.id,
false,
function(data) {
- assert.equal(data.last_activity_at > 0, true);
+ assert.ok(data.delete_at > 0);
done();
},
function(err) {
@@ -275,7 +274,7 @@ describe('Client.User', function() {
}
);
});
- });*/
+ });
it('sendPasswordReset', function(done) {
TestHelper.initBasic(() => {