Skip to content

Commit 8ca510a

Browse files
committed
test: dedupe feishu media account setup
1 parent b213348 commit 8ca510a

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

extensions/feishu/src/media.test.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,21 @@ function expectMediaTimeoutClientConfigured(): void {
6464
);
6565
}
6666

67+
function mockResolvedFeishuAccount() {
68+
resolveFeishuAccountMock.mockReturnValue({
69+
configured: true,
70+
accountId: "main",
71+
config: {},
72+
appId: "app_id",
73+
appSecret: "app_secret",
74+
domain: "feishu",
75+
});
76+
}
77+
6778
describe("sendMediaFeishu msg_type routing", () => {
6879
beforeEach(() => {
6980
vi.clearAllMocks();
70-
71-
resolveFeishuAccountMock.mockReturnValue({
72-
configured: true,
73-
accountId: "main",
74-
config: {},
75-
appId: "app_id",
76-
appSecret: "app_secret",
77-
domain: "feishu",
78-
});
81+
mockResolvedFeishuAccount();
7982

8083
normalizeFeishuTargetMock.mockReturnValue("ou_target");
8184
resolveReceiveIdTypeMock.mockReturnValue("open_id");
@@ -483,15 +486,7 @@ describe("sanitizeFileNameForUpload", () => {
483486
describe("downloadMessageResourceFeishu", () => {
484487
beforeEach(() => {
485488
vi.clearAllMocks();
486-
487-
resolveFeishuAccountMock.mockReturnValue({
488-
configured: true,
489-
accountId: "main",
490-
config: {},
491-
appId: "app_id",
492-
appSecret: "app_secret",
493-
domain: "feishu",
494-
});
489+
mockResolvedFeishuAccount();
495490

496491
createFeishuClientMock.mockReturnValue({
497492
im: {

0 commit comments

Comments
 (0)