init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { describe, expect, it } from 'vitest';
import { appendConsequenceRecord, buildConsequenceLedgerSummary } from './consequenceLedger';
describe('consequenceLedger', () => {
it('builds consequence records from signals and reactions', () => {
const ledger = appendConsequenceRecord({
existing: [],
signals: [
{
id: 'signal-1',
signalType: 'accept_contract',
threadIds: ['thread-1'],
},
],
reactions: [
{
id: 'reaction-1',
characterId: 'archer-hero',
reactionType: 'disapprove',
reason: '她对这一步明显有保留。',
relatedThreadIds: ['thread-1'],
createdAt: new Date().toISOString(),
},
],
});
expect(ledger.length).toBe(2);
expect(buildConsequenceLedgerSummary(ledger)).toContain('accept_contract');
});
});