Skip to content

test(ui): end-to-end AppTest tests for all 9 tabs; coverage floor in CI - #13

Merged
Hj1308 merged 5 commits into
mainfrom
claude/nifty-dirac-57byzj
Oct 2, 2026
Merged

Hj1308 merged 5 commits into
mainfrom
claude/nifty-dirac-57byzj

Conversation

@Hj1308

@Hj1308 Hj1308 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • New tests/test_app_ui.py (marker ui): drives the real Streamlit app with streamlit.testing.v1.AppTest, with in-memory CSV/XLSX uploads.
    • Smoke: 9 tabs load; CSV and XLSX uploads produce no exception or error in any tab.
    • Tab 1: one summary row per catalyst; best model ∈ MODEL_NAMES; manual exclusion drops "points used" by one; a Time (h) header warns; a t=0 row leaves R² unchanged.
    • Tabs 2–9: each changes its main input and checks a concrete output (linearisation R² table, removal plots, mass-normalised TOF, Arrhenius inputs, H₂O₂ efficiency table, comparison axes, Arrhenius Eₐ > 0 from a slower and a faster run, residual R² changes with the model).
  • CI: --cov-fail-under=81.

Review fixes on top of the original commits

  • The Removal test looked for element type "imgs"; Streamlit 1.64 (what CI installs) reports "image", so it failed on Linux. It now accepts both.
  • The Arrhenius test uploaded the same file for 25 °C and 60 °C (Ea = 0, nothing tested); the 60 °C file is now faster and the test asserts Ea > 0.

Verification

171 tests pass; coverage of app_ods.py 18 % → 78 %, total 45 % → 83 % (floor 81 %); ruff check / ruff format --check clean. No change to app code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GN1ANT89MKDjHRXcnjgSjo


Generated by Claude Code

Hj1308 and others added 5 commits October 2, 2026 21:45
…non-degenerate

The Removal-tab test looked for children of type "imgs"; Streamlit 1.64
(what CI installs) reports "image", so the test failed on Linux. Accept
both.

The Arrhenius test uploaded the same file for 25 and 60 °C, so k was equal
at both temperatures and Ea = 0; it only checked the columns. The 60 °C
file is now faster and the test asserts Ea > 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GN1ANT89MKDjHRXcnjgSjo
@Hj1308
Hj1308 merged commit b0db38c into main Oct 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants