Fix Read .grbl

This commit is contained in:
chk
2026-06-14 13:57:02 +02:00
parent c68ce406a6
commit 551dded4dc
3 changed files with 28 additions and 3 deletions

View File

@@ -82,6 +82,22 @@ test('Stepping ohne aktives Programm → auto-lädt Default (leer → EMPTY_PROG
expect(a.programId).toBe(cfg.defaultProgramId); // Default wurde geladen
});
test('FShow ohne FLoad → auto-lädt Default und liefert volle Zeilenliste', async () => {
await store.write(cfg.defaultProgramId, {
name: 'log',
lines: [
'G90 G1 x0 y300 z0 a90.00 b-90.00 c0.00 e0.00 f1000 ;1',
'G90 G1 x10 y300 z0 a0.00 b-90.00 c0.00 e0.00 f1000 ;2',
],
});
const a = new ActiveState();
const state = await a.show(); // frisch, ohne vorheriges FLoad/FPoint
expect(state.programId).toBe(cfg.defaultProgramId);
expect(state.lineCount).toBe(2);
expect(state.lines).toHaveLength(2); // volle Liste für die Anzeige
expect(state.lines[0]).toContain('a90.00'); // in Grad, wie gespeichert
});
test('Stepping nach Neustart liest Default-Programm von Disk (FFirst ohne FLoad)', async () => {
// Simuliert: log.gcode liegt auf Disk, frischer ActiveState (wie nach Container-Neustart)
await store.write(cfg.defaultProgramId, {