Admclamb/fix e2e tests#34
Open
admclamb wants to merge 5 commits into
Open
Conversation
added 2 commits
May 25, 2026 18:19
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on stabilizing and expanding Cypress E2E coverage by adding deterministic selectors (data-cy), introducing reusable Cypress helpers (Auth0 UI login/signup + faker-based credentials), and updating some CTA copy/tests to align with the E2E flows.
Changes:
- Add
data-cyhooks to key UI elements used by Cypress (submission cards, submissions container, code editor, table rows). - Add Cypress support utilities (Auth0 UI commands, faker-based credential generators) and new E2E specs for account + submission flows.
- Update landing/sidebar CTA copy (“Get Started” → “Join Today”, “Login” → “Log In”) and adjust unit tests accordingly.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/features/problem/problem-submissions/submission-card.tsx | Adds data-cy hook to each submission card for E2E selection. |
| src/features/problem/problem-submissions/problem-submissions.tsx | Adds data-cy hook to submissions container card. |
| src/features/landing/hero/hero.tsx | Updates primary CTA text to “Join Today”. |
| src/features/landing/hero/hero.test.tsx | Updates assertions to match CTA text change. |
| src/features/auth/auth-callback/auth-callback.tsx | Simplifies post-auth redirect logic (now always dashboard when account exists). |
| src/components/ui/data-table.tsx | Adds data-cy hook on clickable rows for E2E selection. |
| src/components/layouts/sidebar-layout/app-sidebar/unauthenticated-account.tsx | Updates unauthenticated button labels (“Login” → “Log In”, “Get Started” → “Join Today”). |
| src/components/layouts/sidebar-layout/app-sidebar/unauthenticated-account.test.tsx | Updates assertions to match label changes. |
| src/components/code-editor/code-editor.tsx | Wraps CodeMirror in a data-cy="code-editor" container for E2E selection. |
| package.json | Adds dotenv devDependency (used by Cypress config). |
| pnpm-lock.yaml | Lockfile update for dotenv. |
| cypress/support/faker-commands/faker-data.ts | Adds Cypress commands to generate random email/username/password for tests. |
| cypress/support/e2e.ts | Adds Cypress support entrypoint importing commands/helpers. |
| cypress/support/commands.ts | Adds Cypress commands scaffold file (currently comments only). |
| cypress/support/auth/auth0.ts | Adds Cypress commands for Auth0 UI login/signup via cy.origin. |
| cypress/e2e/submission.cy.ts | Adds E2E tests for submitting solutions and viewing submissions list. |
| cypress/e2e/account.cy.ts | Improves account E2E flows (signup/setup + logout/login). |
| cypress.config.ts | Exposes new test-user env values for Cypress runs. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
cypress/support/auth/auth0.ts:19
- Same issue as above:
Cypress.expose("auth0_domain")isn’t defined in-repo. UseCypress.env("auth0_domain")(with config values coming fromcypress.config.tsenv) to avoid relying on an unknown API.
cy.origin(
Cypress.expose("auth0_domain"),
{ args: { username, password } },
({ username, password }) => {
src/features/problem/problem-submissions/problem-submissions.tsx:61
- Same as above: spreading
{...props}afterdata-cyallows the selector to be overridden. Put{...props}first sodata-cyremains stable for E2E.
<Card data-cy="submissions-card" {...props}>
Comment on lines
+7
to
+11
| cy.get("[data-cy=login-btn]").click(); | ||
| cy.loginViaAuth0Ui( | ||
| Cypress.expose("test_user_email"), | ||
| Cypress.expose("test_user_password") | ||
| ); |
Comment on lines
14
to
21
| expose: { | ||
| auth0_domain: process.env.AUTH0_DOMAIN, | ||
| auth0_audience: process.env.AUTH0_AUDIENCE, | ||
| auth0_scope: "", | ||
| auth0_client_id: process.env.AUTH0_CLIENT_ID, | ||
| test_user_email: process.env.TEST_USER_EMAIL, | ||
| test_user_password: process.env.TEST_USER_PASSWORD, | ||
| }, |
Comment on lines
+10
to
+13
| username = faker.internet | ||
| .username() | ||
| .replace(/[^a-zA-Z0-9-_]/g, "") | ||
| .slice(0, 16); |
Comment on lines
16
to
20
| if (account !== null) { | ||
| if (!account.usernameLastChangedAt) { | ||
| redirect(routerConfig.accountSetup.path); | ||
| } else { | ||
| redirect(routerConfig.dashboard.path); | ||
| } | ||
| redirect(routerConfig.dashboard.path); | ||
| } else { | ||
| redirect(routerConfig.home.path); | ||
| } |
Comment on lines
63
to
67
| @@ -66,12 +66,12 @@ describe("Hero", () => { | |||
| expect(screen.getByText("Join Today")).toBeInTheDocument(); | |||
| }); | |||
Comment on lines
+2
to
+5
| cy.origin( | ||
| Cypress.expose("auth0_domain"), | ||
| { args: { email, password } }, | ||
| ({ email, password }) => { |
| export function ProblemSubmissionsEmpty(props: ProblemSubmissionsProps) { | ||
| return ( | ||
| <Card {...props}> | ||
| <Card data-cy="submissions-card" {...props}> |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.