agent-messenger 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +15 -2
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/shared/chromium/decryptor.d.ts +6 -0
- package/dist/src/shared/chromium/decryptor.d.ts.map +1 -1
- package/dist/src/shared/chromium/decryptor.js +26 -6
- package/dist/src/shared/chromium/decryptor.js.map +1 -1
- package/e2e/channeltalk.e2e.test.ts +13 -13
- package/e2e/channeltalkbot.e2e.test.ts +13 -13
- package/e2e/discord.e2e.test.ts +24 -24
- package/e2e/discordbot.e2e.test.ts +16 -16
- package/e2e/instagram.e2e.test.ts +10 -10
- package/e2e/kakaotalk.e2e.test.ts +7 -7
- package/e2e/line.e2e.test.ts +8 -8
- package/e2e/slack.e2e.test.ts +34 -34
- package/e2e/slackbot.e2e.test.ts +14 -14
- package/e2e/teams.e2e.test.ts +23 -23
- package/e2e/telegram.e2e.test.ts +8 -8
- package/e2e/webex.e2e.test.ts +14 -14
- package/e2e/whatsapp.e2e.test.ts +8 -8
- package/e2e/whatsappbot.e2e.test.ts +6 -6
- package/package.json +1 -1
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/channeltalk/client.test.ts +26 -26
- package/src/platforms/channeltalk/commands/auth.test.ts +16 -16
- package/src/platforms/channeltalk/commands/bot.test.ts +2 -2
- package/src/platforms/channeltalk/commands/chat.test.ts +3 -3
- package/src/platforms/channeltalk/commands/group.test.ts +4 -4
- package/src/platforms/channeltalk/commands/manager.test.ts +2 -2
- package/src/platforms/channeltalk/commands/message.test.ts +17 -17
- package/src/platforms/channeltalk/commands/snapshot.test.ts +7 -7
- package/src/platforms/channeltalk/commands/whoami.test.ts +3 -3
- package/src/platforms/channeltalk/credential-manager.test.ts +18 -18
- package/src/platforms/channeltalk/ensure-auth.test.ts +5 -5
- package/src/platforms/channeltalk/index.test.ts +23 -23
- package/src/platforms/channeltalk/token-extractor.test.ts +21 -21
- package/src/platforms/channeltalk/types.test.ts +12 -12
- package/src/platforms/channeltalkbot/client.test.ts +14 -14
- package/src/platforms/channeltalkbot/commands/auth.test.ts +16 -16
- package/src/platforms/channeltalkbot/commands/bot.test.ts +6 -6
- package/src/platforms/channeltalkbot/commands/chat.test.ts +9 -9
- package/src/platforms/channeltalkbot/commands/group.test.ts +6 -6
- package/src/platforms/channeltalkbot/commands/manager.test.ts +3 -3
- package/src/platforms/channeltalkbot/commands/message.test.ts +10 -10
- package/src/platforms/channeltalkbot/commands/snapshot.test.ts +7 -7
- package/src/platforms/channeltalkbot/commands/whoami.test.ts +4 -4
- package/src/platforms/channeltalkbot/credential-manager.test.ts +27 -27
- package/src/platforms/channeltalkbot/index.test.ts +15 -15
- package/src/platforms/discord/client.test.ts +28 -28
- package/src/platforms/discord/commands/auth.test.ts +7 -7
- package/src/platforms/discord/commands/channel.test.ts +7 -7
- package/src/platforms/discord/commands/dm.test.ts +4 -4
- package/src/platforms/discord/commands/file.test.ts +4 -4
- package/src/platforms/discord/commands/friend.test.ts +6 -6
- package/src/platforms/discord/commands/member.test.ts +5 -5
- package/src/platforms/discord/commands/mention.test.ts +5 -5
- package/src/platforms/discord/commands/message.test.ts +9 -9
- package/src/platforms/discord/commands/note.test.ts +6 -6
- package/src/platforms/discord/commands/profile.test.ts +4 -4
- package/src/platforms/discord/commands/reaction.test.ts +5 -5
- package/src/platforms/discord/commands/server.test.ts +7 -7
- package/src/platforms/discord/commands/snapshot.test.ts +6 -6
- package/src/platforms/discord/commands/thread.test.ts +6 -6
- package/src/platforms/discord/commands/user.test.ts +5 -5
- package/src/platforms/discord/commands/whoami.test.ts +6 -6
- package/src/platforms/discord/credential-manager.test.ts +16 -16
- package/src/platforms/discord/ensure-auth.test.ts +8 -8
- package/src/platforms/discord/index.test.ts +17 -17
- package/src/platforms/discord/listener.test.ts +33 -33
- package/src/platforms/discord/token-extractor.test.ts +53 -53
- package/src/platforms/discord/types.test.ts +26 -26
- package/src/platforms/discordbot/client.test.ts +31 -31
- package/src/platforms/discordbot/commands/auth.test.ts +18 -18
- package/src/platforms/discordbot/commands/channel.test.ts +11 -11
- package/src/platforms/discordbot/commands/file.test.ts +7 -7
- package/src/platforms/discordbot/commands/message.test.ts +25 -25
- package/src/platforms/discordbot/commands/reaction.test.ts +6 -6
- package/src/platforms/discordbot/commands/server.test.ts +12 -12
- package/src/platforms/discordbot/commands/snapshot.test.ts +13 -13
- package/src/platforms/discordbot/commands/thread.test.ts +10 -10
- package/src/platforms/discordbot/commands/user.test.ts +9 -9
- package/src/platforms/discordbot/commands/whoami.test.ts +4 -4
- package/src/platforms/discordbot/credential-manager.test.ts +28 -28
- package/src/platforms/instagram/client.test.ts +18 -18
- package/src/platforms/instagram/commands/auth.test.ts +11 -11
- package/src/platforms/instagram/commands/chat.test.ts +6 -6
- package/src/platforms/instagram/commands/message.test.ts +11 -11
- package/src/platforms/instagram/commands/shared.test.ts +12 -12
- package/src/platforms/instagram/commands/whoami.test.ts +3 -3
- package/src/platforms/instagram/credential-manager.test.ts +21 -21
- package/src/platforms/instagram/ensure-auth.test.ts +4 -4
- package/src/platforms/instagram/index.test.ts +9 -9
- package/src/platforms/instagram/listener.test.ts +8 -8
- package/src/platforms/instagram/token-extractor.test.ts +35 -35
- package/src/platforms/kakaotalk/client.test.ts +33 -33
- package/src/platforms/kakaotalk/commands/auth.test.ts +11 -11
- package/src/platforms/kakaotalk/commands/chat.test.ts +6 -6
- package/src/platforms/kakaotalk/commands/message.test.ts +7 -7
- package/src/platforms/kakaotalk/commands/whoami.test.ts +5 -5
- package/src/platforms/kakaotalk/credential-manager.test.ts +15 -15
- package/src/platforms/kakaotalk/index.test.ts +15 -15
- package/src/platforms/kakaotalk/listener.test.ts +17 -17
- package/src/platforms/line/client.test.ts +17 -17
- package/src/platforms/line/commands/auth.test.ts +8 -8
- package/src/platforms/line/commands/chat.test.ts +7 -7
- package/src/platforms/line/commands/friend.test.ts +6 -6
- package/src/platforms/line/commands/message.test.ts +7 -7
- package/src/platforms/line/commands/whoami.test.ts +6 -6
- package/src/platforms/line/credential-manager.test.ts +17 -17
- package/src/platforms/line/index.test.ts +10 -10
- package/src/platforms/line/listener.test.ts +15 -15
- package/src/platforms/line/types.test.ts +14 -14
- package/src/platforms/slack/cli.test.ts +8 -8
- package/src/platforms/slack/client.test.ts +151 -151
- package/src/platforms/slack/commands/activity.test.ts +13 -13
- package/src/platforms/slack/commands/auth.test.ts +34 -34
- package/src/platforms/slack/commands/bookmark.test.ts +9 -9
- package/src/platforms/slack/commands/channel.test.ts +17 -17
- package/src/platforms/slack/commands/drafts.test.ts +7 -7
- package/src/platforms/slack/commands/emoji.test.ts +3 -3
- package/src/platforms/slack/commands/file.test.ts +12 -12
- package/src/platforms/slack/commands/message.test.ts +19 -19
- package/src/platforms/slack/commands/pin.test.ts +7 -7
- package/src/platforms/slack/commands/reaction.test.ts +10 -10
- package/src/platforms/slack/commands/reminder.test.ts +9 -9
- package/src/platforms/slack/commands/saved.test.ts +7 -7
- package/src/platforms/slack/commands/sections.test.ts +5 -5
- package/src/platforms/slack/commands/snapshot.test.ts +13 -13
- package/src/platforms/slack/commands/unread.test.ts +6 -6
- package/src/platforms/slack/commands/user.test.ts +10 -10
- package/src/platforms/slack/commands/usergroup.test.ts +15 -15
- package/src/platforms/slack/commands/whoami.test.ts +6 -6
- package/src/platforms/slack/commands/workspace.test.ts +26 -26
- package/src/platforms/slack/credential-manager.test.ts +14 -14
- package/src/platforms/slack/ensure-auth.test.ts +21 -21
- package/src/platforms/slack/index.test.ts +12 -12
- package/src/platforms/slack/listener.test.ts +17 -17
- package/src/platforms/slack/token-extractor-node.test.ts +2 -2
- package/src/platforms/slack/token-extractor.test.ts +37 -37
- package/src/platforms/slack/types.test.ts +21 -21
- package/src/platforms/slackbot/client.test.ts +22 -22
- package/src/platforms/slackbot/commands/auth.test.ts +14 -14
- package/src/platforms/slackbot/commands/channel.test.ts +7 -7
- package/src/platforms/slackbot/commands/message.test.ts +13 -13
- package/src/platforms/slackbot/commands/reaction.test.ts +6 -6
- package/src/platforms/slackbot/commands/user.test.ts +7 -7
- package/src/platforms/slackbot/commands/whoami.test.ts +4 -4
- package/src/platforms/slackbot/credential-manager.test.ts +22 -22
- package/src/platforms/slackbot/types.test.ts +7 -7
- package/src/platforms/teams/client.test.ts +30 -30
- package/src/platforms/teams/commands/auth.test.ts +8 -8
- package/src/platforms/teams/commands/channel.test.ts +7 -7
- package/src/platforms/teams/commands/file.test.ts +4 -4
- package/src/platforms/teams/commands/message.test.ts +5 -5
- package/src/platforms/teams/commands/reaction.test.ts +4 -4
- package/src/platforms/teams/commands/snapshot.test.ts +7 -7
- package/src/platforms/teams/commands/team.test.ts +8 -8
- package/src/platforms/teams/commands/user.test.ts +4 -4
- package/src/platforms/teams/commands/whoami.test.ts +6 -6
- package/src/platforms/teams/credential-manager.test.ts +17 -17
- package/src/platforms/teams/ensure-auth.test.ts +13 -13
- package/src/platforms/teams/index.test.ts +15 -15
- package/src/platforms/teams/token-extractor.test.ts +219 -145
- package/src/platforms/teams/token-extractor.ts +13 -2
- package/src/platforms/teams/types.test.ts +26 -26
- package/src/platforms/telegram/app-config.test.ts +4 -4
- package/src/platforms/telegram/chat-utils.test.ts +12 -12
- package/src/platforms/telegram/client.test.ts +4 -4
- package/src/platforms/telegram/commands/auth.test.ts +16 -16
- package/src/platforms/telegram/commands/chat.test.ts +9 -9
- package/src/platforms/telegram/commands/message.test.ts +6 -6
- package/src/platforms/telegram/commands/shared.test.ts +3 -3
- package/src/platforms/telegram/commands/whoami.test.ts +3 -3
- package/src/platforms/telegram/credential-manager.test.ts +10 -10
- package/src/platforms/telegram/types.test.ts +6 -6
- package/src/platforms/webex/app-config.test.ts +8 -8
- package/src/platforms/webex/cli.test.ts +5 -5
- package/src/platforms/webex/client.test.ts +65 -65
- package/src/platforms/webex/commands/auth.test.ts +18 -18
- package/src/platforms/webex/commands/member.test.ts +5 -5
- package/src/platforms/webex/commands/message.test.ts +12 -12
- package/src/platforms/webex/commands/snapshot.test.ts +5 -5
- package/src/platforms/webex/commands/space.test.ts +10 -10
- package/src/platforms/webex/commands/whoami.test.ts +6 -6
- package/src/platforms/webex/credential-manager.test.ts +22 -22
- package/src/platforms/webex/encryption.test.ts +4 -4
- package/src/platforms/webex/ensure-auth.test.ts +5 -5
- package/src/platforms/webex/index.test.ts +5 -5
- package/src/platforms/webex/markdown-to-html.test.ts +33 -33
- package/src/platforms/webex/token-extractor.test.ts +23 -23
- package/src/platforms/webex/types.test.ts +27 -27
- package/src/platforms/wechatbot/client.test.ts +27 -27
- package/src/platforms/wechatbot/commands/auth.test.ts +15 -15
- package/src/platforms/wechatbot/commands/message.test.ts +8 -8
- package/src/platforms/wechatbot/commands/template.test.ts +9 -9
- package/src/platforms/wechatbot/commands/user.test.ts +7 -7
- package/src/platforms/wechatbot/commands/whoami.test.ts +5 -5
- package/src/platforms/wechatbot/credential-manager.test.ts +18 -18
- package/src/platforms/wechatbot/index.test.ts +10 -10
- package/src/platforms/wechatbot/types.test.ts +25 -25
- package/src/platforms/whatsapp/commands/auth.test.ts +13 -13
- package/src/platforms/whatsapp/commands/chat.test.ts +8 -8
- package/src/platforms/whatsapp/commands/message.test.ts +10 -10
- package/src/platforms/whatsapp/commands/whoami.test.ts +3 -3
- package/src/platforms/whatsapp/credential-manager.test.ts +23 -23
- package/src/platforms/whatsapp/ensure-auth.test.ts +4 -4
- package/src/platforms/whatsapp/index.test.ts +8 -8
- package/src/platforms/whatsapp/types.test.ts +42 -42
- package/src/platforms/whatsappbot/client.test.ts +27 -27
- package/src/platforms/whatsappbot/commands/auth.test.ts +14 -14
- package/src/platforms/whatsappbot/commands/message.test.ts +16 -16
- package/src/platforms/whatsappbot/commands/template.test.ts +9 -9
- package/src/platforms/whatsappbot/commands/whoami.test.ts +5 -5
- package/src/platforms/whatsappbot/credential-manager.test.ts +18 -18
- package/src/platforms/whatsappbot/index.test.ts +7 -7
- package/src/platforms/whatsappbot/types.test.ts +18 -18
- package/src/shared/chromium/browsers.test.ts +22 -22
- package/src/shared/chromium/cookie-reader.test.ts +13 -13
- package/src/shared/chromium/decryptor.test.ts +97 -32
- package/src/shared/chromium/decryptor.ts +27 -6
- package/src/shared/utils/concurrency.test.ts +6 -6
- package/src/shared/utils/derived-key-cache.test.ts +11 -11
- package/src/tui/utils.test.ts +31 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, mock,
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
const originalConsoleLog = console.log
|
|
4
4
|
|
|
@@ -49,7 +49,7 @@ describe('chat commands', () => {
|
|
|
49
49
|
})
|
|
50
50
|
|
|
51
51
|
describe('list', () => {
|
|
52
|
-
|
|
52
|
+
it('lists chat rooms', async () => {
|
|
53
53
|
await chatCommand.parseAsync(['list'], { from: 'user' })
|
|
54
54
|
|
|
55
55
|
expect(mockGetChats).toHaveBeenCalled()
|
|
@@ -59,21 +59,21 @@ describe('chat commands', () => {
|
|
|
59
59
|
expect(output[0].name).toBe('General')
|
|
60
60
|
})
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
it('passes --search option to getChats', async () => {
|
|
63
63
|
await chatCommand.parseAsync(['list', '--search', 'General'], { from: 'user' })
|
|
64
64
|
|
|
65
65
|
const call = mockGetChats.mock.calls[0][0] as { all?: boolean; search?: string }
|
|
66
66
|
expect(call.search).toBe('General')
|
|
67
67
|
})
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
it('passes --all flag to getChats', async () => {
|
|
70
70
|
await chatCommand.parseAsync(['list', '--all'], { from: 'user' })
|
|
71
71
|
|
|
72
72
|
const call = mockGetChats.mock.calls[0][0] as { all?: boolean; search?: string }
|
|
73
73
|
expect(call.all).toBe(true)
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
it('passes account option to withKakaoClient', async () => {
|
|
77
77
|
await chatCommand.parseAsync(['list', '--account', 'my-account'], { from: 'user' })
|
|
78
78
|
|
|
79
79
|
expect(mockWithKakaoClient).toHaveBeenCalledWith(
|
|
@@ -82,7 +82,7 @@ describe('chat commands', () => {
|
|
|
82
82
|
)
|
|
83
83
|
})
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
it('outputs empty array when no chats', async () => {
|
|
86
86
|
mockGetChats.mockImplementation(() => Promise.resolve([]))
|
|
87
87
|
|
|
88
88
|
await chatCommand.parseAsync(['list'], { from: 'user' })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, mock,
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
const originalConsoleLog = console.log
|
|
4
4
|
|
|
@@ -48,7 +48,7 @@ describe('message commands', () => {
|
|
|
48
48
|
})
|
|
49
49
|
|
|
50
50
|
describe('list', () => {
|
|
51
|
-
|
|
51
|
+
it('fetches messages for a chat room with default count', async () => {
|
|
52
52
|
await messageCommand.parseAsync(['list', 'chat-123', '--count', '20'], { from: 'user' })
|
|
53
53
|
|
|
54
54
|
expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 20, from: undefined })
|
|
@@ -58,19 +58,19 @@ describe('message commands', () => {
|
|
|
58
58
|
expect(output[0].message).toBe('Hello')
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
it('respects --count option', async () => {
|
|
62
62
|
await messageCommand.parseAsync(['list', 'chat-123', '--count', '5'], { from: 'user' })
|
|
63
63
|
|
|
64
64
|
expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 5, from: undefined })
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
it('respects --from option', async () => {
|
|
68
68
|
await messageCommand.parseAsync(['list', 'chat-123', '--count', '20', '--from', '999'], { from: 'user' })
|
|
69
69
|
|
|
70
70
|
expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 20, from: '999' })
|
|
71
71
|
})
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
it('passes account option to withKakaoClient', async () => {
|
|
74
74
|
await messageCommand.parseAsync(['list', 'chat-123', '--count', '20', '--account', 'my-account'], {
|
|
75
75
|
from: 'user',
|
|
76
76
|
})
|
|
@@ -83,7 +83,7 @@ describe('message commands', () => {
|
|
|
83
83
|
})
|
|
84
84
|
|
|
85
85
|
describe('send', () => {
|
|
86
|
-
|
|
86
|
+
it('sends a message to a chat room', async () => {
|
|
87
87
|
await messageCommand.parseAsync(['send', 'chat-123', 'Hello world'], { from: 'user' })
|
|
88
88
|
|
|
89
89
|
expect(mockSendMessage).toHaveBeenCalledWith('chat-123', 'Hello world')
|
|
@@ -92,7 +92,7 @@ describe('message commands', () => {
|
|
|
92
92
|
expect(output.message).toBe('Hi there')
|
|
93
93
|
})
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
it('passes account option to withKakaoClient', async () => {
|
|
96
96
|
await messageCommand.parseAsync(['send', 'chat-123', 'Hi', '--account', 'my-account'], { from: 'user' })
|
|
97
97
|
|
|
98
98
|
expect(mockWithKakaoClient).toHaveBeenCalledWith(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, mock,
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
const originalConsoleLog = console.log
|
|
4
4
|
|
|
@@ -68,7 +68,7 @@ describe('whoami command', () => {
|
|
|
68
68
|
console.log = originalConsoleLog
|
|
69
69
|
})
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
it('outputs profile information', async () => {
|
|
72
72
|
await whoamiCommand.parseAsync([], { from: 'user' })
|
|
73
73
|
|
|
74
74
|
expect(mockGetProfile).toHaveBeenCalled()
|
|
@@ -78,7 +78,7 @@ describe('whoami command', () => {
|
|
|
78
78
|
expect(output.profile_image_url).toBe('https://example.com/avatar.jpg')
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
it('outputs enriched profile fields', async () => {
|
|
82
82
|
await whoamiCommand.parseAsync([], { from: 'user' })
|
|
83
83
|
|
|
84
84
|
const output = JSON.parse(consoleLogSpy.mock.calls[0][0])
|
|
@@ -92,7 +92,7 @@ describe('whoami command', () => {
|
|
|
92
92
|
expect(output.email_verified).toBe(true)
|
|
93
93
|
})
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
it('passes account option to withKakaoClient', async () => {
|
|
96
96
|
await whoamiCommand.parseAsync(['--account', 'my-account'], { from: 'user' })
|
|
97
97
|
|
|
98
98
|
expect(mockWithKakaoClient).toHaveBeenCalledWith(
|
|
@@ -101,7 +101,7 @@ describe('whoami command', () => {
|
|
|
101
101
|
)
|
|
102
102
|
})
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
it('outputs profile with pretty flag', async () => {
|
|
105
105
|
await whoamiCommand.parseAsync(['--pretty'], { from: 'user' })
|
|
106
106
|
|
|
107
107
|
expect(mockGetProfile).toHaveBeenCalled()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, describe, expect,
|
|
1
|
+
import { afterAll, describe, expect, it } from 'bun:test'
|
|
2
2
|
import { rmSync } from 'node:fs'
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
|
|
@@ -35,7 +35,7 @@ afterAll(() => {
|
|
|
35
35
|
|
|
36
36
|
describe('KakaoCredentialManager', () => {
|
|
37
37
|
describe('load', () => {
|
|
38
|
-
|
|
38
|
+
it('returns default config when file does not exist', async () => {
|
|
39
39
|
const manager = setup()
|
|
40
40
|
const config = await manager.load()
|
|
41
41
|
|
|
@@ -44,7 +44,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
44
44
|
})
|
|
45
45
|
|
|
46
46
|
describe('save/load round-trip', () => {
|
|
47
|
-
|
|
47
|
+
it('creates file and can be re-read via load', async () => {
|
|
48
48
|
const manager = setup()
|
|
49
49
|
const account = makeAccount()
|
|
50
50
|
const config = {
|
|
@@ -62,21 +62,21 @@ describe('KakaoCredentialManager', () => {
|
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
describe('getAccount', () => {
|
|
65
|
-
|
|
65
|
+
it('returns null when no accounts exist', async () => {
|
|
66
66
|
const manager = setup()
|
|
67
67
|
const account = await manager.getAccount()
|
|
68
68
|
|
|
69
69
|
expect(account).toBeNull()
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
it('returns null for nonexistent account ID', async () => {
|
|
73
73
|
const manager = setup()
|
|
74
74
|
const account = await manager.getAccount('nonexistent')
|
|
75
75
|
|
|
76
76
|
expect(account).toBeNull()
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
it('returns account by explicit ID', async () => {
|
|
80
80
|
const manager = setup()
|
|
81
81
|
const account = makeAccount()
|
|
82
82
|
|
|
@@ -86,7 +86,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
86
86
|
expect(retrieved).toEqual(account)
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
it('returns current account when no ID given', async () => {
|
|
90
90
|
const manager = setup()
|
|
91
91
|
const account = makeAccount()
|
|
92
92
|
|
|
@@ -98,7 +98,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
describe('setAccount', () => {
|
|
101
|
-
|
|
101
|
+
it('stores account and auto-sets current_account if null', async () => {
|
|
102
102
|
const manager = setup()
|
|
103
103
|
const account = makeAccount()
|
|
104
104
|
|
|
@@ -109,7 +109,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
109
109
|
expect(config.accounts['test-account']).toEqual(account)
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
it('does NOT override existing current_account', async () => {
|
|
113
113
|
const manager = setup()
|
|
114
114
|
const first = makeAccount({ account_id: 'first-account' })
|
|
115
115
|
const second = makeAccount({ account_id: 'second-account' })
|
|
@@ -123,14 +123,14 @@ describe('KakaoCredentialManager', () => {
|
|
|
123
123
|
})
|
|
124
124
|
|
|
125
125
|
describe('listAccounts', () => {
|
|
126
|
-
|
|
126
|
+
it('returns empty array for empty config', async () => {
|
|
127
127
|
const manager = setup()
|
|
128
128
|
const accounts = await manager.listAccounts()
|
|
129
129
|
|
|
130
130
|
expect(accounts).toEqual([])
|
|
131
131
|
})
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
it('returns all accounts with correct is_current flag', async () => {
|
|
134
134
|
const manager = setup()
|
|
135
135
|
const first = makeAccount({ account_id: 'first-account' })
|
|
136
136
|
const second = makeAccount({ account_id: 'second-account' })
|
|
@@ -149,7 +149,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
149
149
|
})
|
|
150
150
|
|
|
151
151
|
describe('setCurrentAccount', () => {
|
|
152
|
-
|
|
152
|
+
it('switches active account', async () => {
|
|
153
153
|
const manager = setup()
|
|
154
154
|
const first = makeAccount({ account_id: 'first-account' })
|
|
155
155
|
const second = makeAccount({ account_id: 'second-account' })
|
|
@@ -164,7 +164,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
164
164
|
})
|
|
165
165
|
|
|
166
166
|
describe('removeAccount', () => {
|
|
167
|
-
|
|
167
|
+
it('removes and rotates current to next available', async () => {
|
|
168
168
|
const manager = setup()
|
|
169
169
|
const first = makeAccount({ account_id: 'first-account' })
|
|
170
170
|
const second = makeAccount({ account_id: 'second-account' })
|
|
@@ -181,7 +181,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
181
181
|
expect(current?.account_id).toBe('second-account')
|
|
182
182
|
})
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
it('handles removing non-current account', async () => {
|
|
185
185
|
const manager = setup()
|
|
186
186
|
const first = makeAccount({ account_id: 'first-account' })
|
|
187
187
|
const second = makeAccount({ account_id: 'second-account' })
|
|
@@ -201,7 +201,7 @@ describe('KakaoCredentialManager', () => {
|
|
|
201
201
|
})
|
|
202
202
|
|
|
203
203
|
describe('savePendingLogin/loadPendingLogin/clearPendingLogin', () => {
|
|
204
|
-
|
|
204
|
+
it('handles full save, load, and clear lifecycle', async () => {
|
|
205
205
|
const manager = setup()
|
|
206
206
|
const state = {
|
|
207
207
|
device_uuid: 'uuid-abc',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { expect,
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
CredentialManager,
|
|
@@ -17,58 +17,58 @@ import {
|
|
|
17
17
|
KakaoTalkPushReadEventSchema,
|
|
18
18
|
} from '@/platforms/kakaotalk/index'
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
it('KakaoTalkClient is exported from barrel', () => {
|
|
21
21
|
expect(typeof KakaoTalkClient).toBe('function')
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
it('KakaoTalkError is exported from barrel', () => {
|
|
25
25
|
expect(typeof KakaoTalkError).toBe('function')
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
it('CredentialManager is exported from barrel', () => {
|
|
29
29
|
expect(typeof CredentialManager).toBe('function')
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
it('KakaoCredentialManager is exported from barrel', () => {
|
|
33
33
|
expect(typeof KakaoCredentialManager).toBe('function')
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
it('KakaoTalkListener is exported from barrel', () => {
|
|
37
37
|
expect(typeof KakaoTalkListener).toBe('function')
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
it('KakaoChatSchema is exported from barrel', () => {
|
|
41
41
|
expect(typeof KakaoChatSchema.parse).toBe('function')
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
it('KakaoMessageSchema is exported from barrel', () => {
|
|
45
45
|
expect(typeof KakaoMessageSchema.parse).toBe('function')
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
it('KakaoSendResultSchema is exported from barrel', () => {
|
|
49
49
|
expect(typeof KakaoSendResultSchema.parse).toBe('function')
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
it('KakaoAccountCredentialsSchema is exported from barrel', () => {
|
|
53
53
|
expect(typeof KakaoAccountCredentialsSchema.parse).toBe('function')
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
it('KakaoConfigSchema is exported from barrel', () => {
|
|
57
57
|
expect(typeof KakaoConfigSchema.parse).toBe('function')
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
it('KakaoTalkPushMessageEventSchema is exported from barrel', () => {
|
|
61
61
|
expect(typeof KakaoTalkPushMessageEventSchema.parse).toBe('function')
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
it('KakaoTalkPushMemberEventSchema is exported from barrel', () => {
|
|
65
65
|
expect(typeof KakaoTalkPushMemberEventSchema.parse).toBe('function')
|
|
66
66
|
})
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
it('KakaoTalkPushReadEventSchema is exported from barrel', () => {
|
|
69
69
|
expect(typeof KakaoTalkPushReadEventSchema.parse).toBe('function')
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
it('KakaoProfileSchema is exported from barrel', () => {
|
|
73
73
|
expect(typeof KakaoProfileSchema.parse).toBe('function')
|
|
74
74
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, describe, expect, mock,
|
|
1
|
+
import { afterEach, describe, expect, mock, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import { KakaoTalkListener } from '@/platforms/kakaotalk/listener'
|
|
4
4
|
import type { LocoPacket } from '@/platforms/kakaotalk/protocol/types'
|
|
@@ -67,7 +67,7 @@ describe('KakaoTalkListener', () => {
|
|
|
67
67
|
})
|
|
68
68
|
|
|
69
69
|
describe('start', () => {
|
|
70
|
-
|
|
70
|
+
it('calls login on LocoSession', async () => {
|
|
71
71
|
const client = createMockClient()
|
|
72
72
|
listener = new KakaoTalkListener(client)
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ describe('KakaoTalkListener', () => {
|
|
|
77
77
|
expect(mockLogin).toHaveBeenCalledWith('token', 'user1', 'device1', undefined, 'tablet')
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
it('is idempotent', async () => {
|
|
81
81
|
const client = createMockClient()
|
|
82
82
|
listener = new KakaoTalkListener(client)
|
|
83
83
|
|
|
@@ -89,7 +89,7 @@ describe('KakaoTalkListener', () => {
|
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
describe('connected event', () => {
|
|
92
|
-
|
|
92
|
+
it('emits connected with userId after successful login', async () => {
|
|
93
93
|
const client = createMockClient()
|
|
94
94
|
listener = new KakaoTalkListener(client)
|
|
95
95
|
|
|
@@ -104,7 +104,7 @@ describe('KakaoTalkListener', () => {
|
|
|
104
104
|
})
|
|
105
105
|
|
|
106
106
|
describe('message events', () => {
|
|
107
|
-
|
|
107
|
+
it('emits message on MSG push with parsed fields', async () => {
|
|
108
108
|
const client = createMockClient()
|
|
109
109
|
listener = new KakaoTalkListener(client)
|
|
110
110
|
|
|
@@ -135,7 +135,7 @@ describe('KakaoTalkListener', () => {
|
|
|
135
135
|
})
|
|
136
136
|
|
|
137
137
|
describe('member events', () => {
|
|
138
|
-
|
|
138
|
+
it('emits member_joined on NEWMEM push', async () => {
|
|
139
139
|
const client = createMockClient()
|
|
140
140
|
listener = new KakaoTalkListener(client)
|
|
141
141
|
|
|
@@ -154,7 +154,7 @@ describe('KakaoTalkListener', () => {
|
|
|
154
154
|
expect(joined[0].member.user_id).toBe(42)
|
|
155
155
|
})
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
it('emits member_left on DELMEM push', async () => {
|
|
158
158
|
const client = createMockClient()
|
|
159
159
|
listener = new KakaoTalkListener(client)
|
|
160
160
|
|
|
@@ -175,7 +175,7 @@ describe('KakaoTalkListener', () => {
|
|
|
175
175
|
})
|
|
176
176
|
|
|
177
177
|
describe('read events', () => {
|
|
178
|
-
|
|
178
|
+
it('emits read on DECUNREAD push with watermark', async () => {
|
|
179
179
|
const client = createMockClient()
|
|
180
180
|
listener = new KakaoTalkListener(client)
|
|
181
181
|
|
|
@@ -198,7 +198,7 @@ describe('KakaoTalkListener', () => {
|
|
|
198
198
|
})
|
|
199
199
|
|
|
200
200
|
describe('kakaotalk_event catch-all', () => {
|
|
201
|
-
|
|
201
|
+
it('emits kakaotalk_event for every push event', async () => {
|
|
202
202
|
const client = createMockClient()
|
|
203
203
|
listener = new KakaoTalkListener(client)
|
|
204
204
|
|
|
@@ -224,7 +224,7 @@ describe('KakaoTalkListener', () => {
|
|
|
224
224
|
})
|
|
225
225
|
|
|
226
226
|
describe('stop', () => {
|
|
227
|
-
|
|
227
|
+
it('closes session and prevents reconnection', async () => {
|
|
228
228
|
const client = createMockClient()
|
|
229
229
|
listener = new KakaoTalkListener(client)
|
|
230
230
|
|
|
@@ -239,7 +239,7 @@ describe('KakaoTalkListener', () => {
|
|
|
239
239
|
})
|
|
240
240
|
|
|
241
241
|
describe('reconnection', () => {
|
|
242
|
-
|
|
242
|
+
it('reconnects on session close when still running', async () => {
|
|
243
243
|
const client = createMockClient()
|
|
244
244
|
listener = new KakaoTalkListener(client)
|
|
245
245
|
|
|
@@ -255,7 +255,7 @@ describe('KakaoTalkListener', () => {
|
|
|
255
255
|
expect(mockLogin.mock.calls.length).toBeGreaterThanOrEqual(2)
|
|
256
256
|
})
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
it('emits error and reconnects on login failure', async () => {
|
|
259
259
|
let callCount = 0
|
|
260
260
|
mockLogin.mockImplementation(() => {
|
|
261
261
|
callCount++
|
|
@@ -280,7 +280,7 @@ describe('KakaoTalkListener', () => {
|
|
|
280
280
|
})
|
|
281
281
|
|
|
282
282
|
describe('CHANGESVR', () => {
|
|
283
|
-
|
|
283
|
+
it('resets reconnect attempts to 0 on CHANGESVR push', async () => {
|
|
284
284
|
const client = createMockClient()
|
|
285
285
|
listener = new KakaoTalkListener(client)
|
|
286
286
|
|
|
@@ -294,7 +294,7 @@ describe('KakaoTalkListener', () => {
|
|
|
294
294
|
})
|
|
295
295
|
|
|
296
296
|
describe('KICKOUT', () => {
|
|
297
|
-
|
|
297
|
+
it('emits error and stops without reconnecting', async () => {
|
|
298
298
|
const client = createMockClient()
|
|
299
299
|
listener = new KakaoTalkListener(client)
|
|
300
300
|
|
|
@@ -314,7 +314,7 @@ describe('KakaoTalkListener', () => {
|
|
|
314
314
|
})
|
|
315
315
|
|
|
316
316
|
describe('on/off/once', () => {
|
|
317
|
-
|
|
317
|
+
it('off removes listener', async () => {
|
|
318
318
|
const client = createMockClient()
|
|
319
319
|
listener = new KakaoTalkListener(client)
|
|
320
320
|
|
|
@@ -338,7 +338,7 @@ describe('KakaoTalkListener', () => {
|
|
|
338
338
|
expect(messages[0].message).toBe('first')
|
|
339
339
|
})
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
it('once fires only once', async () => {
|
|
342
342
|
const client = createMockClient()
|
|
343
343
|
listener = new KakaoTalkListener(client)
|
|
344
344
|
|
|
@@ -361,7 +361,7 @@ describe('KakaoTalkListener', () => {
|
|
|
361
361
|
})
|
|
362
362
|
|
|
363
363
|
describe('start after stop', () => {
|
|
364
|
-
|
|
364
|
+
it('resets reconnect attempts on fresh start', async () => {
|
|
365
365
|
const client = createMockClient()
|
|
366
366
|
listener = new KakaoTalkListener(client)
|
|
367
367
|
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { describe, expect,
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import { LineClient } from './client'
|
|
4
4
|
import { LineError } from './types'
|
|
5
5
|
import type { LineChat, LineDevice, LineLoginResult, LineMessage, LineSendResult } from './types'
|
|
6
6
|
|
|
7
7
|
describe('LineClient', () => {
|
|
8
|
-
|
|
8
|
+
it('constructor creates instance without errors', () => {
|
|
9
9
|
const client = new LineClient()
|
|
10
10
|
expect(client).toBeInstanceOf(LineClient)
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
it('constructor accepts a custom credential manager', () => {
|
|
14
14
|
const { LineCredentialManager } = require('./credential-manager')
|
|
15
15
|
const manager = new LineCredentialManager()
|
|
16
16
|
const client = new LineClient(manager)
|
|
17
17
|
expect(client).toBeInstanceOf(LineClient)
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
it('close() is idempotent - can be called multiple times without error', () => {
|
|
21
21
|
const client = new LineClient()
|
|
22
22
|
expect(() => client.close()).not.toThrow()
|
|
23
23
|
expect(() => client.close()).not.toThrow()
|
|
24
24
|
expect(() => client.close()).not.toThrow()
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
it('close() is idempotent after login attempt fails', async () => {
|
|
28
28
|
const client = new LineClient()
|
|
29
29
|
client.close()
|
|
30
30
|
client.close()
|
|
31
31
|
})
|
|
32
32
|
|
|
33
33
|
describe('ensureClient throws when not logged in', () => {
|
|
34
|
-
|
|
34
|
+
it('getChats() throws LineError with code not_connected', async () => {
|
|
35
35
|
const client = new LineClient()
|
|
36
36
|
await expect(client.getChats()).rejects.toThrow(LineError)
|
|
37
37
|
await expect(client.getChats()).rejects.toMatchObject({ code: 'not_connected' })
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
it('getMessages() throws LineError when not logged in', async () => {
|
|
41
41
|
const client = new LineClient()
|
|
42
42
|
await expect(client.getMessages('chat123')).rejects.toThrow(LineError)
|
|
43
43
|
await expect(client.getMessages('chat123')).rejects.toMatchObject({
|
|
@@ -45,7 +45,7 @@ describe('LineClient', () => {
|
|
|
45
45
|
})
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
it('sendMessage() throws LineError when not logged in', async () => {
|
|
49
49
|
const client = new LineClient()
|
|
50
50
|
await expect(client.sendMessage('chat123', 'hello')).rejects.toThrow(LineError)
|
|
51
51
|
await expect(client.sendMessage('chat123', 'hello')).rejects.toMatchObject({
|
|
@@ -55,7 +55,7 @@ describe('LineClient', () => {
|
|
|
55
55
|
})
|
|
56
56
|
|
|
57
57
|
describe('login() without credentials', () => {
|
|
58
|
-
|
|
58
|
+
it('throws LineError when no saved credentials exist', async () => {
|
|
59
59
|
const { LineCredentialManager } = require('./credential-manager')
|
|
60
60
|
const { mkdtemp } = require('node:fs/promises')
|
|
61
61
|
const { tmpdir } = require('node:os')
|
|
@@ -71,7 +71,7 @@ describe('LineClient', () => {
|
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
describe('LineError', () => {
|
|
74
|
-
|
|
74
|
+
it('LineError has correct name, code, and message', () => {
|
|
75
75
|
const err = new LineError('test_code', 'test message')
|
|
76
76
|
expect(err).toBeInstanceOf(Error)
|
|
77
77
|
expect(err).toBeInstanceOf(LineError)
|
|
@@ -80,7 +80,7 @@ describe('LineClient', () => {
|
|
|
80
80
|
expect(err.message).toBe('test message')
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
it('LineError is thrown by getChats and wraps the not_connected error', async () => {
|
|
84
84
|
const client = new LineClient()
|
|
85
85
|
try {
|
|
86
86
|
await client.getChats()
|
|
@@ -95,13 +95,13 @@ describe('LineClient', () => {
|
|
|
95
95
|
})
|
|
96
96
|
|
|
97
97
|
describe('default device detection', () => {
|
|
98
|
-
|
|
98
|
+
it('LineClient can be instantiated (device detection does not throw)', () => {
|
|
99
99
|
expect(() => new LineClient()).not.toThrow()
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
102
|
|
|
103
103
|
describe('type exports', () => {
|
|
104
|
-
|
|
104
|
+
it('LineChat type is correctly shaped', () => {
|
|
105
105
|
const chat: LineChat = {
|
|
106
106
|
chat_id: 'c1234567890abcdef1234567890abcdef',
|
|
107
107
|
type: 'group',
|
|
@@ -114,7 +114,7 @@ describe('LineClient', () => {
|
|
|
114
114
|
expect(chat.member_count).toBe(5)
|
|
115
115
|
})
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
it('LineMessage type is correctly shaped', () => {
|
|
118
118
|
const msg: LineMessage = {
|
|
119
119
|
message_id: 'msg123',
|
|
120
120
|
chat_id: 'chat456',
|
|
@@ -127,7 +127,7 @@ describe('LineClient', () => {
|
|
|
127
127
|
expect(msg.text).toBe('Hello')
|
|
128
128
|
})
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
it('LineMessage text can be null', () => {
|
|
131
131
|
const msg: LineMessage = {
|
|
132
132
|
message_id: 'msg123',
|
|
133
133
|
chat_id: 'chat456',
|
|
@@ -139,7 +139,7 @@ describe('LineClient', () => {
|
|
|
139
139
|
expect(msg.text).toBeNull()
|
|
140
140
|
})
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
it('LineSendResult type is correctly shaped', () => {
|
|
143
143
|
const result: LineSendResult = {
|
|
144
144
|
success: true,
|
|
145
145
|
chat_id: 'chat456',
|
|
@@ -149,7 +149,7 @@ describe('LineClient', () => {
|
|
|
149
149
|
expect(result.success).toBe(true)
|
|
150
150
|
})
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
it('LineLoginResult type is correctly shaped', () => {
|
|
153
153
|
const result: LineLoginResult = {
|
|
154
154
|
authenticated: true,
|
|
155
155
|
account_id: 'u1234567890abcdef1234567890abcdef',
|