From 82d74365bc97b6787544f0f6a5bad882d06d2bab Mon Sep 17 00:00:00 2001 From: MarcosCl98 Date: Mon, 29 Apr 2019 23:23:27 +0200 Subject: [PATCH] deleted consoles.log --- src/index.js | 16 ++-------------- test/ChatManagerTest/foldermanager.test.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 test/ChatManagerTest/foldermanager.test.js diff --git a/src/index.js b/src/index.js index 9427b33e..e0faacc5 100644 --- a/src/index.js +++ b/src/index.js @@ -27,10 +27,7 @@ $('document').ready(async () => { user = await session.getUser(); notifications = new Notifier(user); changeView(true); - console.log("User") - console.log(user) let urlFolder = await FolderManager.getUrlFolder(user.id); - console.log("URL: " + urlFolder); await FolderManager.checkDechatFolder(urlFolder); await initializeGroups(); loadInitialContacts(); @@ -93,8 +90,6 @@ $("#add-group").click(async () => { $("#mesgs").append(content); var friends = await query.getFriends(); friends = removeDupes(friends, "id"); - console.log("amigos") - console.log(friends) for (var friend of friends) { $("#group-candidates").append("
"); } @@ -105,7 +100,6 @@ $("#add-group").click(async () => { selected.push($(this).attr("name")); }) selected.push(user.id); - console.log(selected); var name = $("#group-name").val(); const rejected = await chatManager.createGroup(name, selected, user.id); @@ -228,7 +222,6 @@ async function startChat(friend, i) { await chat.init(); //Initializate sentMessages array //We start the chat when we make sure we have the folder created. - console.log("Chat with " + friend.id + " opened") $("#mesgs").empty(); //Delete all the content of mesgs $(".profile_bar").empty(); //Empty profile upper bar @@ -268,7 +261,7 @@ async function startChat(friend, i) { if ($("#contentText" + i).val().length > 0) $("#msg_history" + i).append(messageContent); - //console.log(i) + sendMessage(chat, i, user, friend); // Get the input field }); @@ -294,7 +287,6 @@ async function startChat(friend, i) { } async function startGroupChat(group, i) { - console.log("Group chat " + group.id + " opened") $("#mesgs").empty(); //Delete all the content of mesgs @@ -373,7 +365,7 @@ async function addEnterListener(chat, i, user, friend) { if ($("#contentText" + i).val().length > 0) $("#msg_history" + i).append(messageContent); - //console.log(i) + sendMessage(chat, i, user, friend); }); @@ -405,7 +397,6 @@ async function addGroupEnterListener(group, i) { if ($("#contentText" + i).val().length > 0) $("#msg_history" + i).append(messageContent); - //console.log(i) sendGroupMessage(group, i); }); @@ -474,7 +465,6 @@ function updateUIMessages(messages, index) { "" ""; } - //console.log("Messages loop " + messages[i].content); $("#msg_history" + index).append(sentMessage); } @@ -486,9 +476,7 @@ function updateUIMessages(messages, index) { async function updateGroupUIMessages(messages, index) { $("#msg_history" + index).empty(); var i; - console.log(messages) for (i = 0; i < messages.length; i++) { - console.log(messages[i]) let sentMessage; var userToCompare = "https://" + messages[i].user + "/profile/card#me"; let msgContent; diff --git a/test/ChatManagerTest/foldermanager.test.js b/test/ChatManagerTest/foldermanager.test.js new file mode 100644 index 00000000..a3259df3 --- /dev/null +++ b/test/ChatManagerTest/foldermanager.test.js @@ -0,0 +1,11 @@ +const folderManager = require("../../src/lib/ChatManager/ChatWriter/FolderManager"); +const fc = require("solid-file-client"); + +describe('Methods of folder', () => { + const folderRoute = "https://marcoslpz1998.solid.community/dechat/marcoslpz1999.solid/"; + it("Read Folder", async function(){ + const folder = await folderManager.readFolder(folderRoute); + expect(folder).toBe("Paco"); + + }) +}) \ No newline at end of file