fix: feuille xlsx vide editable avec quadrillage vierge BUG-094
This commit is contained in:
@@ -96,6 +96,29 @@ class TestXlsxDisplay:
|
||||
resp = client.get(f"/api/file/{VAULT}", params={"path": "corrupt.xlsx"})
|
||||
assert resp.status_code == 500
|
||||
|
||||
def test_empty_sheet_renders_an_editable_blank_grid(self, client, test_vault_dir):
|
||||
"""BUG-094 — a blank sheet used to render as a bare « Feuille vide »
|
||||
paragraph with no cell, so a freshly added sheet could not be filled
|
||||
and had no way to insert a row/column. It now exposes a small editable
|
||||
grid with real A1 coordinates."""
|
||||
from openpyxl import Workbook
|
||||
|
||||
path = Path(test_vault_dir) / "blank.xlsx"
|
||||
wb = Workbook()
|
||||
wb.active.title = "Vide"
|
||||
wb.create_sheet("Vide2")
|
||||
wb.save(str(path))
|
||||
|
||||
resp = client.get(f"/api/file/{VAULT}", params={"path": "blank.xlsx"})
|
||||
assert resp.status_code == 200
|
||||
vide = next(s for s in resp.json()["xlsx_sheets"] if s["name"] == "Vide")
|
||||
assert "Feuille vide" not in vide["html"]
|
||||
assert 'data-cell="A1"' in vide["html"]
|
||||
assert 'data-cell="H20"' in vide["html"] # last cell of the blank grid
|
||||
assert vide["rows"] == 20
|
||||
assert vide["cols"] == 8
|
||||
assert vide["truncated"] is False
|
||||
|
||||
|
||||
# ── Index parity (tree visibility) ────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user