summaryrefslogtreecommitdiff
path: root/packages/misskey-js/test
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-24 21:32:46 +0900
committerGitHub <noreply@github.com>2025-03-24 21:32:46 +0900
commitf1f24e39d2df3135493e2c2087230b428e2d02b7 (patch)
treea5ae0e9d2cf810649b2f4e08ef4d00ce7ea91dc9 /packages/misskey-js/test
parentfix(frontend): fix broken styles (diff)
downloadsharkey-f1f24e39d2df3135493e2c2087230b428e2d02b7.tar.gz
sharkey-f1f24e39d2df3135493e2c2087230b428e2d02b7.tar.bz2
sharkey-f1f24e39d2df3135493e2c2087230b428e2d02b7.zip
Feat: Chat (#15686)
* wip * wip * wip * wip * wip * wip * Update types.ts * Create 1742203321812-chat.js * wip * wip * Update room.vue * Update home.vue * Update home.vue * Update ja-JP.yml * Update index.d.ts * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * wip * Update home.vue * clean up * Update misskey-js.api.md * wip * wip * wip * wip * wip * wip * wip * wip * wip * lint fixes * lint * Update UserEntityService.ts * search * wip * 🎨 * wip * Update home.ownedRooms.vue * wip * Update CHANGELOG.md * Update style.scss * wip * improve performance * improve performance * Update timeline.test.ts
Diffstat (limited to 'packages/misskey-js/test')
-rw-r--r--packages/misskey-js/test/streaming.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/packages/misskey-js/test/streaming.ts b/packages/misskey-js/test/streaming.ts
index 06b55cd8af..7e784cd20c 100644
--- a/packages/misskey-js/test/streaming.ts
+++ b/packages/misskey-js/test/streaming.ts
@@ -42,26 +42,26 @@ describe('Streaming', () => {
test('useChannel with parameters', async () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
- const messagingChannelReceived: any[] = [];
- const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
- messaging.on('message', payload => {
- messagingChannelReceived.push(payload);
+ const chatChannelReceived: any[] = [];
+ const chat = stream.useChannel('chat', { other: 'aaa' });
+ chat.on('message', payload => {
+ chatChannelReceived.push(payload);
});
const ws = await server.connected;
expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN');
const msg = JSON.parse(await server.nextMessage as string);
- const messagingChannelId = msg.body.id;
+ const chatChannelId = msg.body.id;
expect(msg.type).toEqual('connect');
- expect(msg.body.channel).toEqual('messaging');
- expect(msg.body.params).toEqual({ otherparty: 'aaa' });
- expect(messagingChannelId != null).toEqual(true);
+ expect(msg.body.channel).toEqual('chat');
+ expect(msg.body.params).toEqual({ other: 'aaa' });
+ expect(chatChannelId != null).toEqual(true);
server.send(JSON.stringify({
type: 'channel',
body: {
- id: messagingChannelId,
+ id: chatChannelId,
type: 'message',
body: {
id: 'foo'
@@ -69,7 +69,7 @@ describe('Streaming', () => {
}
}));
- expect(messagingChannelReceived[0]).toEqual({
+ expect(chatChannelReceived[0]).toEqual({
id: 'foo'
});
@@ -81,20 +81,20 @@ describe('Streaming', () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
- stream.useChannel('messaging', { otherparty: 'aaa' });
- stream.useChannel('messaging', { otherparty: 'bbb' });
+ stream.useChannel('chat', { other: 'aaa' });
+ stream.useChannel('chat', { other: 'bbb' });
const ws = await server.connected;
expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN');
const msg = JSON.parse(await server.nextMessage as string);
- const messagingChannelId = msg.body.id;
+ const chatChannelId = msg.body.id;
const msg2 = JSON.parse(await server.nextMessage as string);
- const messagingChannelId2 = msg2.body.id;
+ const chatChannelId2 = msg2.body.id;
- expect(messagingChannelId != null).toEqual(true);
- expect(messagingChannelId2 != null).toEqual(true);
- expect(messagingChannelId).not.toEqual(messagingChannelId2);
+ expect(chatChannelId != null).toEqual(true);
+ expect(chatChannelId2 != null).toEqual(true);
+ expect(chatChannelId).not.toEqual(chatChannelId2);
stream.close();
server.close();
@@ -104,8 +104,8 @@ describe('Streaming', () => {
const server = new WS('wss://misskey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
- const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
- messaging.send('read', { id: 'aaa' });
+ const chat = stream.useChannel('chat', { other: 'aaa' });
+ chat.send('read', { id: 'aaa' });
const ws = await server.connected;
expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN');