feat: enhance auction interactions and player statistics UI
This commit is contained in:
1 parent
6c582ba3cf
commit
be4de61bb7
115 files changed
+13292
-2871
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { sendAuctionChatMessage } from "../src/api/auction-chat.ts";
|
||||
|
||||
test("only confirms delivery when the server returns the saved message", async () => {
|
||||
const message = {
|
||||
id: "saved",
|
||||
displayName: "팀장",
|
||||
message: "확인",
|
||||
sentAt: "2026-11-11T12:00:00Z",
|
||||
};
|
||||
assert.equal(
|
||||
await sendAuctionChatMessage(async () => ({ ok: true, message })),
|
||||
message,
|
||||
);
|
||||
await assert.rejects(
|
||||
sendAuctionChatMessage(async () => ({ ok: true })),
|
||||
/보내지 못했습니다/,
|
||||
);
|
||||
});
|
||||
|
||||
test("disconnection and timeout reject so the outbox can retain the original", async () => {
|
||||
await assert.rejects(sendAuctionChatMessage(undefined), /연결이 끊겼습니다/);
|
||||
await assert.rejects(
|
||||
sendAuctionChatMessage(async () => {
|
||||
throw new Error("timeout");
|
||||
}),
|
||||
/전송을 확인하지 못했습니다/,
|
||||
);
|
||||
});
|
||||
|
||||
test("server rejection is a failure with localized feedback", async () => {
|
||||
await assert.rejects(
|
||||
sendAuctionChatMessage(async () => ({
|
||||
ok: false,
|
||||
message: "Chat message must be 300 characters or less.",
|
||||
})),
|
||||
/300자/,
|
||||
);
|
||||
await assert.rejects(
|
||||
sendAuctionChatMessage(async () => ({
|
||||
ok: false,
|
||||
message: "Internal implementation detail",
|
||||
})),
|
||||
/메시지를 보내지 못했습니다/,
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user