test(integration): verify committed read-model projections

This commit is contained in:
2026-08-09 23:55:07 +00:00
parent 6063b91b73
commit 6cc5157b6d
4 changed files with 29 additions and 1 deletions
@@ -306,6 +306,7 @@ integration('adjustGeneralIcon PostgreSQL persistence', () => {
CHECK (request_id <> '${rollbackRequestId}' OR status <> 'SUCCEEDED')
`);
await expect(execute(rollbackCommand)).rejects.toThrow(`violates check constraint "${rollbackConstraint}"`);
expect(hooks.takeCommittedReadModelChanges()).toBeNull();
expect(world.getGeneralById(targetGeneralId)).toMatchObject({
picture: initialPicture,
imageServer: initialImageServer,
@@ -334,6 +335,7 @@ integration('adjustGeneralIcon PostgreSQL persistence', () => {
);
await createInputEvent(actorMismatchCommand, foreignUserId);
await expect(execute(actorMismatchCommand)).rejects.toThrow('actor does not match');
expect(hooks.takeCommittedReadModelChanges()).toBeNull();
expect(world.getGeneralById(targetGeneralId)).toMatchObject({
picture: initialPicture,
imageServer: initialImageServer,
@@ -357,6 +359,13 @@ integration('adjustGeneralIcon PostgreSQL persistence', () => {
generalId: targetGeneralId,
updated: true,
});
expect(hooks.takeCommittedReadModelChanges()).toMatchObject({
generalIds: [targetGeneralId],
mapGeneralIds: [],
frontStatusGeneralIds: [],
lobbyGeneralIds: [targetGeneralId],
reservedGeneralIds: [],
});
expect(world.getGeneralById(targetGeneralId)).toMatchObject({
picture: nextPicture,
imageServer: nextImageServer,