feat(git): Teilen per Snapshot – snapshotAt im Git-Status, Anzeige im Editor, Tests für alle Leser-Routen (ADR 0003 §6)
CI / Storage (mongo) (pull_request) Failing after 1m13s
CI / Storage (postgres) (pull_request) Successful in 1m12s
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Successful in 2m9s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dev-bot BotandClaude Sonnet 5.5 committed 2026-11-25 21:32:14 +00:00
1 parent 448c67912f
commit 3e05096fd6
5 files changed
+81 -3

No files matched your search

+16
View File
@@ -383,6 +383,22 @@ describe('Speichern (Hook beforeBrewSave/afterBrewSave)', ()=>{
});
});
describe('Teilen (Snapshot)', ()=>{
test('Status nennt den Zeitpunkt des Snapshots, ohne Token oder Zugangsdaten', async ()=>{
const { brew, save } = await linked();
const stamp = new Date('2026-01-02T03:04:05Z');
await storage.brews.update({ ...(await storage.brews.findByEditId(brew.editId)), updatedAt: stamp });
let st = await request.get(`/api/git/brews/${brew.editId}`).set(version).set(asAccount(ALICE()));
expect(new Date(st.body.snapshotAt)).toEqual(stamp);
const later = new Date('2026-02-02T03:04:05Z');
await save('Version 2');
await storage.brews.update({ ...(await storage.brews.findByEditId(brew.editId)), updatedAt: later });
st = await request.get(`/api/git/brews/${brew.editId}`).set(version).set(asAccount(ALICE()));
expect(new Date(st.body.snapshotAt)).toEqual(later);
expect(JSON.stringify(st.body)).not.toContain(remote.token);
});
});
describe('Pull und Abgleich beim Öffnen', ()=>{
test('Pull übernimmt den Remote-Stand in den Snapshot (Version + 1)', async ()=>{
const { dir, brew } = await linked();