Skip to content

Commit 71446ad

Browse files
invite get model test changes
1 parent 1ea7df4 commit 71446ad

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

test/unit/models/discordactions.test.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ describe("discordactions", function () {
107107

108108
it("should return true if role doesn't exist in the database", async function () {
109109
const result = await isGroupRoleExists("Test Role");
110+
console.log(result, 'result')
110111
expect(result.wasSuccess).to.equal(true);
111112
expect(getStub.calledOnceWith("rolename", "==", "Test Role")).to.equal(false);
112113
});
@@ -598,18 +599,18 @@ describe("discordactions", function () {
598599
});
599600
});
600601

601-
describe("getUserDiscordInvite", function () {
602+
describe.only("getUserDiscordInvite", function () {
602603
let getStub;
603604

604605
beforeEach(function () {
605-
getStub = sinon.stub(discordInvitesModel, "where").resolves({
606-
get: sinon.stub().returns({
606+
getStub = sinon.stub(discordRoleModel, "where").returns({
607+
get: sinon.stub().resolves({
607608
docs: [
608609
{
609-
id: "zyfdsf",
610+
id: "xyzfdsf",
610611
data: sinon.stub().returns({
611-
inviteLink: "discord.gg/tYU6Gm7e",
612-
userId: "hKzs2IQGe4sLnAuSZ85i",
612+
userId: "xyz",
613+
inviteLink: "discord.gg/fkjasdfjk",
613614
}),
614615
},
615616
],
@@ -623,6 +624,10 @@ describe("discordactions", function () {
623624

624625
it("should return the invite for the user", async function () {
625626
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");
626631
});
627632
});
628633
});

0 commit comments

Comments
 (0)