Repository navigation
test: cover public problem page behavior - #55
Conversation
|
@adityamukesh is attempting to deploy a commit to the Sennai's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks @adityamukesh! This is a very useful first draft, and your scope clarification is correct. Scope confirmed: The tests exercise the real page and I checked
I also temporarily broke 12 behaviors and restored each change afterward. Your tests caught the incorrect solution-request URL, missing example explanation, missing Constraints heading, and missing solution language. They didn’t catch the error, race, or static-props regressions, which matches the remaining work you’ve already noted. For the next push, please add:
Before marking the PR ready for review, please add your own temporary-break-and-restore evidence and the complete results of Keep it up! Thanks for being a valued contributor of Codearena. Please let me know if you'd like any guidance/assistance. |
|
Thanku u for the suggestion and the guidelines.I am working on it .
…On Wed, 14 Oct, 2026, 12:06 am Aaron Zhu, ***@***.***> wrote:
*AlwaysAcing123* left a comment (codearena-oss/codearena#55)
<#55 (comment)>
Thanks @adityamukesh <https://github.com/adityamukesh>! This is a very
useful first draft, and your scope clarification is correct.
*Scope confirmed:* problems/[slug].js is the public summary page. The
editor, Run/Submit controls, and execution results live in
components/practice/ArenaPractice.js. Please keep this PR focused on the
summary page; it contributes to #14
<#14> without closing
the broader issue.
The tests exercise the real page and ProblemDescription, check what
players see, and use a deferred promise to verify loading behavior without
arbitrary sleeps.
I checked 329ad79:
- All 3 new tests pass.
- The full frontend suite passes: 25 suites, 169 tests.
- Lint passes with 0 errors and 4 existing warnings.
- The publication-boundary check passes.
I also temporarily broke 12 behaviors and restored each change afterward.
Your tests caught the incorrect solution-request URL, missing example
explanation, missing Constraints heading, and missing solution language.
They didn’t catch the error, race, or static-props regressions, which
matches the remaining work you’ve already noted.
For the next push, please add:
1.
*Solution-request failures:* non-OK HTTP responses, success: false,
and rejected fetches. The public problem should remain readable, no
accepted solution should appear, and rejected requests should be handled.
2.
*Stale responses:* start a deferred request, rerender after logout or
a problem change, then resolve the old request. Verify that the old
solution doesn’t appear. A check after unmount alone won’t reliably detect
removal of the stale-response guard.
3.
*getStaticProps coverage:* import and call it directly with mocked
fetch.
- A 404 returns { notFound: true } without retries.
- Repeated 5xx responses exhaust the retries and return { notFound:
true, revalidate: 30 }.
- A 5xx followed by success retries and returns the problem with revalidate:
3600.
- Returned problem props exclude testCases and starterCode.
Use fake timers for retry delays so these tests stay deterministic.
Before marking the PR ready for review, please add your own
temporary-break-and-restore evidence and the complete results of cd
frontend && npm test && npm run lint to the description.
Keep it up! Thanks for being a valued contributor of Codearena. Please let
me know if you'd like any guidance/assistance.
—
Reply to this email directly, view it on GitHub
<#55?email_source=notifications&email_token=BWZ65AOOBDFZOI74EXDR4F35TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6152526768>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BWZ65APHOURLNRZVSPQWAYT5TZY3VAVCNFSNUABGKJSXA33TNF2G64TZHMYTIMBYGU2TEMZQHA5US43TOVSTWNJYGM2DGMBSGIZDRILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BWZ65AK357SGYOE5ZCJ67OL5TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/BWZ65AIH3QHVSQSOJ4WWCT35TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Can u please approve the GitHub actions run and Authorize the vercel
preview description for PR#55?
On Wed, 14 Oct, 2026, 9:16 am ADITYA MUKESH, ***@***.***>
wrote:
… Thanku u for the suggestion and the guidelines.I am working on it .
On Wed, 14 Oct, 2026, 12:06 am Aaron Zhu, ***@***.***>
wrote:
> *AlwaysAcing123* left a comment (codearena-oss/codearena#55)
> <#55 (comment)>
>
> Thanks @adityamukesh <https://github.com/adityamukesh>! This is a very
> useful first draft, and your scope clarification is correct.
>
> *Scope confirmed:* problems/[slug].js is the public summary page. The
> editor, Run/Submit controls, and execution results live in
> components/practice/ArenaPractice.js. Please keep this PR focused on the
> summary page; it contributes to #14
> <#14> without closing
> the broader issue.
>
> The tests exercise the real page and ProblemDescription, check what
> players see, and use a deferred promise to verify loading behavior without
> arbitrary sleeps.
>
> I checked 329ad79:
>
> - All 3 new tests pass.
> - The full frontend suite passes: 25 suites, 169 tests.
> - Lint passes with 0 errors and 4 existing warnings.
> - The publication-boundary check passes.
>
> I also temporarily broke 12 behaviors and restored each change afterward.
> Your tests caught the incorrect solution-request URL, missing example
> explanation, missing Constraints heading, and missing solution language.
> They didn’t catch the error, race, or static-props regressions, which
> matches the remaining work you’ve already noted.
>
> For the next push, please add:
>
> 1.
>
> *Solution-request failures:* non-OK HTTP responses, success: false,
> and rejected fetches. The public problem should remain readable, no
> accepted solution should appear, and rejected requests should be handled.
> 2.
>
> *Stale responses:* start a deferred request, rerender after logout or
> a problem change, then resolve the old request. Verify that the old
> solution doesn’t appear. A check after unmount alone won’t reliably detect
> removal of the stale-response guard.
> 3.
>
> *getStaticProps coverage:* import and call it directly with mocked
> fetch.
> - A 404 returns { notFound: true } without retries.
> - Repeated 5xx responses exhaust the retries and return {
> notFound: true, revalidate: 30 }.
> - A 5xx followed by success retries and returns the problem with revalidate:
> 3600.
> - Returned problem props exclude testCases and starterCode.
>
> Use fake timers for retry delays so these tests stay deterministic.
>
> Before marking the PR ready for review, please add your own
> temporary-break-and-restore evidence and the complete results of cd
> frontend && npm test && npm run lint to the description.
>
> Keep it up! Thanks for being a valued contributor of Codearena. Please
> let me know if you'd like any guidance/assistance.
>
> —
> Reply to this email directly, view it on GitHub
> <#55?email_source=notifications&email_token=BWZ65AOOBDFZOI74EXDR4F35TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6152526768>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BWZ65APHOURLNRZVSPQWAYT5TZY3VAVCNFSNUABGKJSXA33TNF2G64TZHMYTIMBYGU2TEMZQHA5US43TOVSTWNJYGM2DGMBSGIZDRILWAI>
> .
> Triage notifications, keep track of coding agent tasks and review pull
> requests on the go with GitHub Mobile for iOS
> <https://github.com/notifications/mobile/ios/BWZ65AK357SGYOE5ZCJ67OL5TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
> and Android
> <https://github.com/notifications/mobile/android/BWZ65AIH3QHVSQSOJ4WWCT35TZY3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJVGI2TENRXGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
> Download it today!
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
|
Thanks for adding these tests, and for your patience while this was waiting on review. The checks are passing. Approved! |
Summary
Adds 17 Jest/React Testing Library tests for
frontend/pages/problems/[slug].js, exercising the real page andProblemDescription:success: false, and rejected fetches.getStaticPropscoverage: 404 without retries, three failed attempts, recovery after a 5xx, revalidation values, and exclusion oftestCases/starterCodefor both response formats.Uses mocked authentication/API boundaries, deferred promises and fake timers. Only the test file changes; no production code, setup, dependency or configuration changes.
Contributes to #14 without closing it. This follows the confirmed summary-page scope and requested follow-up. Run/Submit, testcase tabs, execution feedback and explicit timeout UI belong to the separate practice surface and are outside this PR.
Validation
Run locally with Node 22.23.3:
cd frontend && npm test -- --runInBand: 25 suites, 183 tests passed.cd frontend && npm run lint: 0 errors, 4 existing warnings, all in unchanged files.cd frontend && NEXT_PUBLIC_BACKEND_URL=http://127.0.0.1:3001 npm run build: passed (workspace-root and Edge Runtime deprecation warnings).cd backend && npm test -- --runInBand --silent: 92 suites, 1,509 tests passed, with the CI test environment and local-port access.cd backend && npm run validate:problems: 45/45 valid.node scripts/check-boundary.jsandgit diff --check: passed.Regression evidence
Each of these 15 temporary changes caused relevant tests to fail; each was restored and none is committed:
Limits and assistance
GitHub CI and Vercel deployment authorization are separate from these local results. Browser E2E/manual application testing was not performed locally; this PR changes no UI or production behavior. Implemented and validated with OpenAI Codex assistance; no human review is claimed.