Skip to content

Commit

Permalink
add put requests to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Sep 2, 2024
1 parent e401212 commit a6ff046
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rest/endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ export default {
},
method: "PUT",
majorParams: [0],
mockResponse: ({ params } = {}) => {},
mockResponse: ({ params } = {}) => {
return HttpResponse.json([TEST_DATA.SLASH_COMMAND]);
},
},
getRoles: {
path: (guild_id) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect } from "chai";
import { TEST_CLIENTS } from "../../../../../../src/testData.js";

describe("PUT /applications/${application_id}/commands", function () {
context("make request", function () {
it("should make the request", async function () {
const client = TEST_CLIENTS.ALL_CACHES_ENABLED();
await expect(
client.request.makeRequest("bulkOverwriteGlobalApplicationCommands"),
).to.be.fulfilled;
});
});
});
12 changes: 12 additions & 0 deletions test/requests/PUT/guilds/[guild_id]/bans/[user_id]/request.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expect } from "chai";
import { TEST_CLIENTS } from "../../../../../../../src/testData.js";

describe("PUT /guilds/${guild_id}/bans/${user_id}", function () {
context("make request", function () {
it("should make the request", async function () {
const client = TEST_CLIENTS.ALL_CACHES_ENABLED();
await expect(client.request.makeRequest("putCreateGuildBan")).to.be
.fulfilled;
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expect } from "chai";
import { TEST_CLIENTS } from "../../../../../../../../../src/testData.js";

describe("PUT /guilds/${guild_id}/members/${user_id}/roles/${role_id}", function () {
context("make request", function () {
it("should make the request", async function () {
const client = TEST_CLIENTS.ALL_CACHES_ENABLED();
await expect(client.request.makeRequest("putAddGuildMemberRole")).to.be
.fulfilled;
});
});
});

0 comments on commit a6ff046

Please sign in to comment.