Start with an empty document; offer Datei › Neu and Datei › Muster
A first start (nothing in localStorage) now opens a blank document -- one sheet "Blatt 1" with an empty "Tabelle 1" -- instead of the pre-filled sample. The file menu gets "Neu" (blank document) and "Muster · Umsatzanalyse" (the former seed), both behind a confirm and both starting a fresh undo history. The toolbar's "Zurücksetzen" button is gone; its job is now Datei › Muster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,19 @@ describe('seed document acceptance (canvas model)', () => {
|
||||
expect(val(s, 'Übersicht', 'B2')).toBe(5970);
|
||||
});
|
||||
|
||||
it('newDocument replaces everything with one empty sheet + table and a fresh history', () => {
|
||||
const s = fresh();
|
||||
setCell(s, 'Umsatz', 'B2', '99999');
|
||||
s.newDocument();
|
||||
expect(s.doc.sheets).toHaveLength(1);
|
||||
expect(s.doc.sheets[0].name).toBe('Blatt 1');
|
||||
const [table] = s.doc.sheets[0].objects;
|
||||
expect(table.kind === 'table' && table.name).toBe('Tabelle 1');
|
||||
expect(table.kind === 'table' && Object.keys(table.cells)).toEqual([]);
|
||||
expect(s.doc.namedRanges).toEqual([]);
|
||||
expect(s.canUndo.value).toBe(false);
|
||||
});
|
||||
|
||||
it('inserting a new table and referencing it across sheets works', () => {
|
||||
const s = fresh();
|
||||
const sheet2 = s.doc.sheets[1].id;
|
||||
|
||||
Reference in New Issue
Block a user