feat(git): Teilen von Git-Brews über Server-Snapshot (#9) (#25)
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (push) Successful in 2m12s
CI / Storage (mongo) (push) Successful in 1m41s
CI / Storage (postgres) (push) Successful in 1m13s
Image / Image bauen und pushen (push) Successful in 5m18s

Co-authored-by: Dev (Paperclip) <dev-bot@noreply.git.morlana.online>
This commit was merged in pull request #25.
This commit is contained in:
dev-bot Bot authored and Gitea committed 2026-11-26 01:01:31 +00:00
1 parent adaa10a4dc
commit 3a77763641
8 files changed
+94 -4

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();