feat(git): Teilen per Snapshot – snapshotAt im Git-Status, Anzeige im Editor, Tests für alle Leser-Routen (ADR 0003 §6)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
448c67912f
commit
3e05096fd6
5 files changed
+81
-3
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user