test(stand): cover personal and team metrics dashboards - #2171
Conversation
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
📝 WalkthroughWalkthroughThe UI page objects now use dedicated accessible locators for dashboard controls, metrics, and domain states. Seeded-data browser tests cover all personal KPIs, populated and empty domains, team navigation, member metrics, and team domain states. ChangesSeeded dashboard coverage
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/stand/ui/test_seeded_data_visible.py`:
- Around line 91-92: Update the KPI assertion in the seeded-data visibility test
around view.kpi_value(label) to require non-whitespace text, while continuing to
reject the "—" placeholder. Ensure blank and whitespace-only KPI values fail the
test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bc42f783-5684-4be4-9cd2-b785e55198ee
📒 Files selected for processing (3)
tests/stand/ui/pages/person_view.pytests/stand/ui/pages/team_view.pytests/stand/ui/test_seeded_data_visible.py
| expect(view.kpi_tile(label)).to_be_visible() | ||
| expect(view.kpi_value(label)).not_to_have_text("—") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate file =="
fd -a 'test_seeded_data_visible.py' . || true
echo "== file excerpt =="
cat -n tests/stand/ui/test_seeded_data_visible.py | sed -n '1,150p'
echo "== search kpi_value implementations =="
rg -n "def kpi_value|kpi_value|expect_value|visible|dash|—" tests -S || true
echo "== git diff stat/name/status =="
git diff --stat || true
git diff -- tests/stand/ui/test_seeded_data_visible.py || trueRepository: constructorfabric/insight
Length of output: 50381
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== person_view.kpi_value implementation =="
cat -n tests/stand/ui/pages/person_view.py | sed -n '1,120p'
echo "== deterministic check of current assertion behavior for whitespace values =="
python3 - <<'PY'
import re
values = ["—", "", " ", " ", "\t", "\n", "0", "10️⃣"]
for text in values:
passed = text != "—"
print(repr(text), "->", passed)
PYRepository: constructorfabric/insight
Length of output: 2553
Require a nonempty KPI value.
Line 92 only rejects the "—" placeholder, so blank or whitespace-only values can still pass. Add or update this check to require non-whitespace text as well as rejecting the placeholder.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/stand/ui/test_seeded_data_visible.py` around lines 91 - 92, Update the
KPI assertion in the seeded-data visibility test around view.kpi_value(label) to
require non-whitespace text, while continuing to reject the "—" placeholder.
Ensure blank and whitespace-only KPI values fail the test.
🤖 connectors-ddl snapshot driftThe committed snapshot does not match what this branch actually produces. The regenerated snapshot is waiting in #2172 — review the DDL diff there and merge it into this branch; the gate re-runs on your merge. Refreshed on every drifting gate run (the regen branch is force-pushed), so it reflects this branch as of the last completed run. |
Summary
Validation
ruff checkruff format --checkSummary by CodeRabbit