mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00

* Deprecate legacy sled store * Add e2ee test * Add support for e2ee testing in e2e environment * Tidy up redis support * Attempt to get test working * cleanup test * opportunistic lint * tiny bit of cleanup * remove ref * tweak to homerunner * switch to nightly images for Synapse (to test E2EE) * use nightly * newsfile. * Update bot sdk to support authenticated media (now that Synapse requires it) * fix typings * MatrixError * one more * Graduate the encryption property to stable. * update test config * Update encryption docs. * fix some old config bits
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { MessageEventContent } from "matrix-bot-sdk";
|
|
import { E2ESetupTestTimeout, E2ETestEnv } from "./util/e2e-test";
|
|
import { describe, it, beforeEach, afterEach } from "@jest/globals";
|
|
import { expect } from "chai";
|
|
|
|
describe('Basic test setup', () => {
|
|
let testEnv: E2ETestEnv;
|
|
|
|
beforeEach(async () => {
|
|
testEnv = await E2ETestEnv.createTestEnv({matrixLocalparts: ['user']});
|
|
await testEnv.setUp();
|
|
}, E2ESetupTestTimeout);
|
|
|
|
afterEach(() => {
|
|
return testEnv?.tearDown();
|
|
});
|
|
|
|
it('should be able to invite the bot to a room', async () => {
|
|
const user = testEnv.getUser('user');
|
|
const roomId = await user.createRoom({ name: 'Test room', invite:[testEnv.botMxid] });
|
|
await user.waitForRoomJoin({sender: testEnv.botMxid, roomId });
|
|
const msg = user.waitForRoomEvent<MessageEventContent>({
|
|
eventType: 'm.room.message', sender: testEnv.botMxid, roomId
|
|
});
|
|
await user.sendText(roomId, "!hookshot help");
|
|
// Expect help text.
|
|
expect((await msg).data.content.body).to.include('!hookshot help` - This help text\n');
|
|
});
|
|
});
|