Skip to content

Commit 1105698

Browse files
removed the model test getInvite
1 parent 71446ad commit 1105698

1 file changed

Lines changed: 2 additions & 36 deletions

File tree

test/unit/models/discordactions.test.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const {
2020
fetchGroupToUserMapping,
2121
updateUsersNicknameStatus,
2222
addInviteToInviteModel,
23-
getUserDiscordInvite,
2423
} = require("../../../models/discordactions");
2524
const { groupData, roleData, existingRole, memberGroupData } = require("../../fixtures/discordactions/discordactions");
2625
const cleanDb = require("../../utils/cleanDb");
@@ -107,7 +106,6 @@ describe("discordactions", function () {
107106

108107
it("should return true if role doesn't exist in the database", async function () {
109108
const result = await isGroupRoleExists("Test Role");
110-
console.log(result, 'result')
111109
expect(result.wasSuccess).to.equal(true);
112110
expect(getStub.calledOnceWith("rolename", "==", "Test Role")).to.equal(false);
113111
});
@@ -576,7 +574,7 @@ describe("discordactions", function () {
576574
let addStub;
577575

578576
beforeEach(function () {
579-
addStub = sinon.stub(discordRoleModel, "add").resolves({ id: "invite-test-id" });
577+
addStub = sinon.stub(discordInvitesModel, "add").resolves({ id: "invite-test-id" });
580578
});
581579

582580
afterEach(function () {
@@ -586,7 +584,7 @@ describe("discordactions", function () {
586584
it("should add invite in the invite model for user", async function () {
587585
const inviteObject = { userId: "kfjkasdfl", inviteLink: "discord.gg/xyz" };
588586
const inviteId = await addInviteToInviteModel(inviteObject);
589-
expect(inviteId).to.exist;
587+
expect(inviteId).to.exist; // eslint-disable-line no-unused-expressions
590588
});
591589

592590
it("should throw an error if creating invite fails", async function () {
@@ -598,36 +596,4 @@ describe("discordactions", function () {
598596
});
599597
});
600598
});
601-
602-
describe.only("getUserDiscordInvite", function () {
603-
let getStub;
604-
605-
beforeEach(function () {
606-
getStub = sinon.stub(discordRoleModel, "where").returns({
607-
get: sinon.stub().resolves({
608-
docs: [
609-
{
610-
id: "xyzfdsf",
611-
data: sinon.stub().returns({
612-
userId: "xyz",
613-
inviteLink: "discord.gg/fkjasdfjk",
614-
}),
615-
},
616-
],
617-
}),
618-
});
619-
});
620-
621-
afterEach(function () {
622-
getStub.restore();
623-
});
624-
625-
it("should return the invite for the user", async function () {
626-
const result = await getUserDiscordInvite("xyz");
627-
expect(result.id).to.be.equal("xyzfdsf");
628-
expect(result.notFound).to.be.equal(false);
629-
expect(result.userId).to.be.equals("xyz");
630-
expect(result.inviteLink).to.be.equal("discord.gg/fkjasdfjk");
631-
});
632-
});
633599
});

0 commit comments

Comments
 (0)