fix: 커맨드 차등 생명주기와 로그 그래프를 보강
장수 55종과 수뇌 35종의 상태, 로그, 메시지, 예약 턴 비교를 닫습니다. 실제 시나리오 프로필과 대표 PostgreSQL 수명주기, 즉시 외교와 출병 회귀를 추가하고 발견된 Ref 로그 및 생성 장수 저장 차이를 교정합니다.
This commit is contained in:
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
MESSAGE_MAILBOX_NATIONAL_BASE,
|
||||
MESSAGE_MAILBOX_PUBLIC,
|
||||
resolveMessageTargetIcon,
|
||||
sendMessage,
|
||||
type MessageDraft,
|
||||
type MessageRecordDraft,
|
||||
@@ -88,7 +89,7 @@ describe('sendMessage', () => {
|
||||
expect(store.records[0]!.draft.mailbox).toBe(MESSAGE_MAILBOX_PUBLIC);
|
||||
});
|
||||
|
||||
it('removes diplomacy action from sender copy', async () => {
|
||||
it('clears the entire actionable diplomacy option from the sender copy', async () => {
|
||||
const store = new InMemoryMessageStore();
|
||||
const draft = buildDraft({
|
||||
msgType: 'diplomacy',
|
||||
@@ -98,8 +99,38 @@ describe('sendMessage', () => {
|
||||
|
||||
await sendMessage(store, draft);
|
||||
|
||||
const senderPayload = store.records[1]!.draft.payload.option ?? {};
|
||||
expect(senderPayload).not.toHaveProperty('action');
|
||||
expect(senderPayload).toMatchObject({ payload: 1 });
|
||||
expect(store.records[1]!.draft.payload.option).toBeNull();
|
||||
});
|
||||
|
||||
it('can persist only the receiver copy like Ref Message::send(true)', async () => {
|
||||
const store = new InMemoryMessageStore();
|
||||
const draft = buildDraft({ sendDestOnly: true });
|
||||
|
||||
const result = await sendMessage(store, draft);
|
||||
|
||||
expect(result).toEqual({ receiverId: 1 });
|
||||
expect(store.records).toHaveLength(1);
|
||||
expect(store.records[0]!.draft.mailbox).toBe(draft.dest.generalId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveMessageTargetIcon', () => {
|
||||
it('uses the product shared origin by default and accepts an explicit differential origin', () => {
|
||||
expect(resolveMessageTargetIcon()).toBe('https://sam-image.hided.net/icons/default.jpg');
|
||||
expect(resolveMessageTargetIcon(null, 'https://dev-sam-ref.hided.net/image/icons/')).toBe(
|
||||
'https://dev-sam-ref.hided.net/image/icons/default.jpg'
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps a non-default shared picture and legacy user-icon marker visible', () => {
|
||||
expect(
|
||||
resolveMessageTargetIcon(
|
||||
{ picture: '장수/관우.png', imageServer: 0 },
|
||||
'https://dev-sam-ref.hided.net/image/icons'
|
||||
)
|
||||
).toBe('https://dev-sam-ref.hided.net/image/icons/장수/관우.png');
|
||||
expect(resolveMessageTargetIcon({ picture: 'users/custom.webp', imageServer: 1 })).toBe(
|
||||
'd_pic/users/custom.webp'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user