forked from cadence/out-of-your-element
Refactor kstate resource uploading
This commit is contained in:
parent
07a133eba9
commit
24a3b9b0f4
7 changed files with 196 additions and 18 deletions
39
d2m/actions/create-space.test.js
Normal file
39
d2m/actions/create-space.test.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
// @ts-check
|
||||
|
||||
const mixin = require("mixin-deep")
|
||||
const {guildToKState, ensureSpace} = require("./create-space")
|
||||
const {kstateStripConditionals, kstateUploadMxc} = require("../../matrix/kstate")
|
||||
const {test} = require("supertape")
|
||||
const testData = require("../../test/data")
|
||||
|
||||
const passthrough = require("../../passthrough")
|
||||
const {db} = passthrough
|
||||
|
||||
test("guild2space: can generate kstate for a guild, passing privacy level 0", async t => {
|
||||
t.deepEqual(
|
||||
await kstateUploadMxc(kstateStripConditionals(await guildToKState(testData.guild.general, 0))),
|
||||
{
|
||||
"m.room.avatar/": {
|
||||
discord_path: "/icons/112760669178241024/a_f83622e09ead74f0c5c527fe241f8f8c.png?size=1024",
|
||||
url: "mxc://cadence.moe/zKXGZhmImMHuGQZWJEFKJbsF"
|
||||
},
|
||||
"m.room.guest_access/": {
|
||||
guest_access: "can_join"
|
||||
},
|
||||
"m.room.history_visibility/": {
|
||||
history_visibility: "invited"
|
||||
},
|
||||
"m.room.join_rules/": {
|
||||
join_rule: "invite"
|
||||
},
|
||||
"m.room.name/": {
|
||||
name: "Psychonauts 3"
|
||||
},
|
||||
"m.room.power_levels/": {
|
||||
users: {
|
||||
"@test_auto_invite:example.org": 100
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue