Default Log

This commit is contained in:
chk
2026-06-14 11:55:14 +02:00
parent b68bdfa9b4
commit 988e8ec752
3 changed files with 16 additions and 6 deletions

View File

@@ -71,10 +71,15 @@ test('Cursor wird beim Speichern als !-Kommentar abgelegt (genau eine Zeile)', a
expect(units.splitComment(marked[0]).code).toBe('G4 P0.1');
});
test('Aktion ohne aktives Programm → NO_ACTIVE_PROGRAM', async () => {
test('Stepping ohne aktives Programm → NO_ACTIVE_PROGRAM', async () => {
const a = new ActiveState();
expect(() => a.next()).toThrow(); // NO_ACTIVE_PROGRAM
await expect(a.appendPoint({ x: 0, y: 0, z: 0, a: 0, b: 0, c: 0, e: 0 })).rejects.toMatchObject({
code: 'NO_ACTIVE_PROGRAM',
});
});
test('FPoint ohne aktives Programm → auto-lädt Default-Programm (log)', async () => {
const a = new ActiveState();
// appendPoint lädt automatisch das Default-Programm und legt es leer an
const r = await a.appendPoint({ x: 0, y: 0, z: 0, a: 0, b: 0, c: 0, e: 0 });
expect(r.index).toBe(0);
expect(a.programId).toBeTruthy(); // Default-Programm wurde geladen
});