Skip to content

Admclamb/fix e2e tests#34

Open
admclamb wants to merge 5 commits into
mainfrom
admclamb/fix-e2e-tests
Open

Admclamb/fix e2e tests#34
admclamb wants to merge 5 commits into
mainfrom
admclamb/fix-e2e-tests

Conversation

@admclamb
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 26, 2026 03:23
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-aw-prod-01 Ready Ready Preview, Comment May 26, 2026 4:08am
web-aw-scrum-01 Ready Ready Preview, Comment May 26, 2026 4:08am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-cy hooks 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. Use Cypress.env("auth0_domain") (with config values coming from cypress.config.ts env) 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} after data-cy allows the selector to be overridden. Put {...props} first so data-cy remains 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 thread cypress.config.ts
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 thread src/features/landing/hero/hero.test.tsx Outdated
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}>
@sonarqubecloud
Copy link
Copy Markdown

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