Fix bulk insert Playwright expectations

Keep copied spreadsheet templates aligned with the single-row insert columns while still previewing auto primary keys in bulk insert rows.

Treat invalid JSON during live bulk-insert validation as unfinished input so Firefox does not expose browser-specific parse errors while typing.
This commit is contained in:
Simon Willison 2026-07-03 12:47:22 -07:00
commit 8f32a8f134
2 changed files with 12 additions and 5 deletions

View file

@ -1109,10 +1109,14 @@ def test_insert_row_flow_uses_custom_column_field(page, datasette_server):
"Previewing 1 row."
)
preview_text = dialog.locator(".row-edit-bulk-preview-table").inner_text()
assert "id" in preview_text
assert "title" in preview_text
assert "metadata" in preview_text
assert "id" not in preview_text
assert "From CSV" in preview_text
assert (
dialog.locator(".row-edit-bulk-preview-auto").first.text_content()
== "auto"
)
assert "null" not in preview_text
assert "undefined" not in preview_text
preview_cell_style = dialog.locator(