left4me/l4d2web/tests
mwiegand 058acb9c5c
feat(files-overlay): recursive directory delete + fix nested-file save misroute
Two related fixes to the overlay file manager, found in the same session.

1. Nested-file save was silently moving the file (fix).
   The Filename input is pre-filled with the full relative path
   (intentional: phone-friendly move-via-edit when drag-and-drop
   isn't an option). The save handler compared it against the
   basename only, so every save of a file in a subfolder built
   newPath = parent + "/" + editedFilename and re-routed the
   file into a doubly-nested path (e.g. cfg/tick60.cfg ->
   cfg/cfg/tick60.cfg). All three sites in editor.js now compare
   against relPath. Two e2e tests pin both directions: save-without-
   edit leaves the file untouched, edit-the-path performs the
   intended move.

2. Recursive directory delete + visible 409 errors (feature).
   GET /files/delete_preview enumerates what a recursive delete
   would remove (files + dirs + symlinks, capped at 500 entries,
   followlinks=False). POST /files/delete accepts an optional
   recursive=1 form param that uses shutil.rmtree (default still
   refuses non-empty dirs, preserving the historical safety
   guard). The delete confirm modal now opens an inline preview
   for non-empty folders, with a scrollable list and a count
   summary. The error handler falls back to r.rawText so the
   server's text bodies (like "directory is not empty") finally
   surface to the user instead of "HTTP 409".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 19:49:45 +02:00
..
e2e feat(files-overlay): recursive directory delete + fix nested-file save misroute 2026-05-20 19:49:45 +02:00
__init__.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
test_admin_users.py secure(l4d2web): block non-admin writes on system overlays; last-admin guard on deactivate 2026-05-14 22:24:19 +02:00
test_alembic_migrations.py feat(l4d2-web): script overlay schema — add overlay.script + last_build_status, drop globals tables 2026-05-08 15:33:04 +02:00
test_auth.py test(datetime): pin tz-aware contract for fixtures (red until UtcDateTime lands) 2026-05-16 11:55:48 +02:00
test_blueprints.py feat(editor-v2): wire data-editor-language attrs into three textareas 2026-05-17 02:06:58 +02:00
test_cli.py tests/cli: cover running+cancelling idempotency, tighten app-context scope 2026-05-11 23:18:54 +02:00
test_config.py config: allow SESSION_COOKIE_SECURE override and disable on test deploy 2026-05-07 00:56:48 +02:00
test_console_routes.py feat(l4d2-web): console panel UI on server detail page 2026-05-14 21:39:21 +02:00
test_health.py security: harden boundary inputs and production defaults 2026-05-07 00:53:33 +02:00
test_host_commands.py fix(l4d2-web): keep SSE log stream from pinning gunicorn threads 2026-05-08 11:18:56 +02:00
test_job_logs.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
test_job_worker.py job_worker: don't duplicate streamed stderr on HostCommandError 2026-05-10 22:52:54 +02:00
test_l4d2_facade.py docs(log-streaming): record that L4D2 logaddress UDP emit is dead 2026-05-20 00:19:50 +02:00
test_live_state_poller.py test(datetime): pin tz-aware contract for fixtures (red until UtcDateTime lands) 2026-05-16 11:55:48 +02:00
test_migrations.py feat(live-state): add schema for snapshots, sessions, steam profiles 2026-05-12 21:18:24 +02:00
test_models.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
test_overlay_builders.py overlay_builders: restore symlink overwrite guards + nits 2026-05-11 23:01:38 +02:00
test_overlay_creation.py feat(l4d2-web): overlay path helpers and creation 2026-05-07 16:38:39 +02:00
test_overlay_files.py feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
test_overlay_files_routes.py feat(files-overlay): recursive directory delete + fix nested-file save misroute 2026-05-20 19:49:45 +02:00
test_overlays.py auth: reject sessions older than user.password_changed_at 2026-05-11 21:54:13 +02:00
test_pages.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
test_profile.py tests/test_profile: hoist sqlalchemy import to module top 2026-05-11 22:01:29 +02:00
test_rate_limit.py rate-limit: extract generic helper, reuse from login 2026-05-11 21:45:51 +02:00
test_rcon.py feat(l4d2-web): add execute_command to rcon service with full test coverage 2026-05-14 21:21:41 +02:00
test_script_overlay_routes.py feat(editor-v2): wire data-editor-language attrs into three textareas 2026-05-17 02:06:58 +02:00
test_security.py fix(csp): allow workshop preview thumbnails from steamusercontent.com 2026-05-16 11:22:30 +02:00
test_seed_script_overlays.py feat(l4d2-web): seed example script overlays from examples/script-overlays/ 2026-05-08 18:41:08 +02:00
test_servers.py fix(server-detail): tall modal heights, true recent count, re-fetch on reopen, drop dead macro + arg 2026-05-17 21:40:20 +02:00
test_status_and_server_logs.py feat(live-state): ?view=recent-modal branch + single-column modal list 2026-05-17 21:25:36 +02:00
test_steam_users.py feat(live-state): use Steam avatarfull (184x184), downscale in CSS 2026-05-12 23:17:51 +02:00
test_steam_workshop.py feat(workshop): batched expand_collections() helper 2026-05-19 00:23:54 +02:00
test_timeago.py feat(app): register timeago Jinja filter 2026-05-16 11:10:59 +02:00
test_url_addressable_modals.py feat(files): delete legacy editor dialog + gut editor.js legacy paths 2026-05-17 16:20:27 +02:00
test_workshop_overlay_models.py feat(l4d2-web): script overlay schema — add overlay.script + last_build_status, drop globals tables 2026-05-08 15:33:04 +02:00
test_workshop_paths.py feat(l4d2-web): overlay path helpers and creation 2026-05-07 16:38:39 +02:00
test_workshop_routes.py refactor(workshop): autodetect collections; drop input_mode form field 2026-05-19 00:27:50 +02:00