mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-03-31 03:15:40 +00:00
* add .pre-commit-config.yaml Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> * .editorconfig: decrease indent size for text * .pre-commit-config.yaml: remove prettier Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> * .editorconfig consistency. * .pre-commit-config.yaml: restore sample hooks * .editorconfig: disable indent_size for LICENSE & NOTICE * pre-commit run --all-files * tsconfig.json: tabs to spaces * .pre-commit-config.yaml: update editorconfig-checker to 2.7.2 * .editorconfig: disable indent_size for markdown * mjolnir-entrypoint.sh: retab * .editorconfig: also exclude json from indent checking * test/nginx.conf: retab * test/integration/commands/redactCommandTest.ts: remove leading space * retab or remove leading whitespaces for the rest of the files * src/appservice/datastore.ts remove newlines * test/integration/commands/roomTest.ts: remove leading space. --------- Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> Co-authored-by: gnuxie <Gnuxie@protonmail.com>
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import config from "../../src/config";
|
|
import { newTestUser, noticeListener } from "./clientHelper"
|
|
|
|
describe("Test: !help command", function() {
|
|
let client;
|
|
this.beforeEach(async function () {
|
|
client = await newTestUser(this.config.homeserverUrl, { name: { contains: "-" }});;
|
|
await client.start();
|
|
})
|
|
this.afterEach(async function () {
|
|
await client.stop();
|
|
})
|
|
it('Mjolnir responded to !mjolnir help', async function() {
|
|
this.timeout(30000);
|
|
// send a messgage
|
|
await client.joinRoom(this.config.managementRoom);
|
|
// listener for getting the event reply
|
|
let reply = new Promise((resolve, reject) => {
|
|
client.on('room.message', noticeListener(this.mjolnir.managementRoomId, (event) => {
|
|
if (event.content.body.includes("Print status information")) {
|
|
resolve(event);
|
|
}
|
|
}))});
|
|
// check we get one back
|
|
console.log(config);
|
|
await client.sendMessage(this.mjolnir.managementRoomId, {msgtype: "m.text", body: "!mjolnir help"})
|
|
await reply
|
|
})
|
|
})
|