Test invite interaction & code coverage
This commit is contained in:
parent
65170c1282
commit
bad8c5b8c2
15 changed files with 407 additions and 161 deletions
49
test/data.js
49
test/data.js
|
@ -4128,7 +4128,54 @@ module.exports = {
|
|||
guild_id: "112760669178241024"
|
||||
},
|
||||
position: 0
|
||||
}
|
||||
},
|
||||
ephemeral_message: {
|
||||
webhook_id: "684280192553844747",
|
||||
type: 20,
|
||||
tts: false,
|
||||
timestamp: "2024-09-29T11:22:04.865000+00:00",
|
||||
position: 0,
|
||||
pinned: false,
|
||||
nonce: "1289910062243905536",
|
||||
mentions: [],
|
||||
mention_roles: [],
|
||||
mention_everyone: false,
|
||||
interaction_metadata: {
|
||||
user: {baby: true},
|
||||
type: 2,
|
||||
name: "invite",
|
||||
id: "1289910063691206717",
|
||||
command_type: 1,
|
||||
authorizing_integration_owners: {baby: true}
|
||||
},
|
||||
interaction: {
|
||||
user: {baby: true},
|
||||
type: 2,
|
||||
name: "invite",
|
||||
id: "1289910063691206717"
|
||||
},
|
||||
id: "1289910064995504182",
|
||||
flags: 64,
|
||||
embeds: [],
|
||||
edited_timestamp: null,
|
||||
content: "`@cadence:cadence.moe` is already in this server and this channel.",
|
||||
components: [],
|
||||
channel_id: "1100319550446252084",
|
||||
author: {
|
||||
username: "Matrix Bridge",
|
||||
public_flags: 0,
|
||||
id: "684280192553844747",
|
||||
global_name: null,
|
||||
discriminator: "5728",
|
||||
clan: null,
|
||||
bot: true,
|
||||
avatar_decoration_data: null,
|
||||
avatar: "48ae3c24f2a6ec5c60c41bdabd904018"
|
||||
},
|
||||
attachments: [],
|
||||
application_id: "684280192553844747"
|
||||
},
|
||||
shard_id: 0
|
||||
},
|
||||
interaction_message: {
|
||||
thinking_interaction_without_bot_user: {
|
||||
|
|
|
@ -3,6 +3,9 @@ BEGIN TRANSACTION;
|
|||
INSERT INTO guild_space (guild_id, space_id, privacy_level) VALUES
|
||||
('112760669178241024', '!jjWAGMeQdNrVZSSfvz:cadence.moe', 0);
|
||||
|
||||
INSERT INTO guild_active (guild_id, autocreate) VALUES
|
||||
('112760669178241024', 1);
|
||||
|
||||
INSERT INTO channel_room (channel_id, room_id, name, nick, thread_parent, custom_avatar) VALUES
|
||||
('112760669178241024', '!kLRqKKUQXcibIMtOpl:cadence.moe', 'heave', 'main', NULL, NULL),
|
||||
('497161350934560778', '!CzvdIdUQXgUjDVKxeU:cadence.moe', 'amanda-spam', NULL, NULL, NULL),
|
||||
|
|
|
@ -23,8 +23,8 @@ reg.id = "baby" // don't actually take authenticated actions on the server
|
|||
reg.as_token = "baby"
|
||||
reg.hs_token = "baby"
|
||||
reg.ooye.bridge_origin = "https://bridge.example.org"
|
||||
reg.ooye.invite = []
|
||||
|
||||
/** @type {import("heatsync").default} */ // @ts-ignore
|
||||
const sync = new HeatSync({watchFS: false})
|
||||
|
||||
const discord = {
|
||||
|
@ -35,6 +35,7 @@ const discord = {
|
|||
id: "684280192553844747"
|
||||
},
|
||||
channels: new Map([
|
||||
[data.channel.general.id, data.channel.general],
|
||||
["497161350934560778", {
|
||||
guild_id: "497159726455455754"
|
||||
}],
|
||||
|
@ -117,7 +118,6 @@ file._actuallyUploadDiscordFileToMxc = function(url, res) { throw new Error(`Not
|
|||
require("../src/matrix/kstate.test")
|
||||
require("../src/matrix/api.test")
|
||||
require("../src/matrix/file.test")
|
||||
require("../src/matrix/power.test")
|
||||
require("../src/matrix/read-registration.test")
|
||||
require("../src/matrix/txnid.test")
|
||||
require("../src/d2m/actions/create-room.test")
|
||||
|
@ -136,4 +136,5 @@ file._actuallyUploadDiscordFileToMxc = function(url, res) { throw new Error(`Not
|
|||
require("../src/m2d/converters/event-to-message.test")
|
||||
require("../src/m2d/converters/utils.test")
|
||||
require("../src/m2d/converters/emoji-sheet.test")
|
||||
require("../src/discord/interactions/invite.test")
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue