Skip to content

feat: frontend tests for platform/ forms and pages#414

Merged
payamnj merged 1 commit intomasterfrom
copilot/create-frontend-tests-platform
May 5, 2026
Merged

feat: frontend tests for platform/ forms and pages#414
payamnj merged 1 commit intomasterfrom
copilot/create-frontend-tests-platform

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

No frontend tests existed for any of the platform/ components. This adds 18 test files covering all major forms, dialogs, and page-level components.

New tests (frontend/src/test/platform/)

Dialogs & confirmation forms

  • DeleteContentForm, DeleteCoursePopup, DeleteUserDialog — confirmation message interpolation, cancel/delete callbacks, API integration
  • EnableCourseSwitchPopup — enable/disable title variants, confirm flow

Data-entry forms

  • OrganizationForm — create/edit modes, required-field and URL validation, success callback
  • UserForm — add/edit modes, role descriptions, instructor display-name validation (whitespace-only bypass of HTML required)
  • CreateImapForm — field validation, folder chip add/remove, submit
  • CreateInstructorForm — email/display-name validation, submit
  • EnrollMenu — dropdown open, manual enrollment dialog, email validation, success flow

Composite components

  • AddImapConnectionForm — no-connection accordion vs. existing-connection select
  • AddInstructorsSection — no-instructor accordion, instructor select label, pre-selection chips
  • ContentTable — fetch-loaded rows, delete and click events dispatched via eventHandler
  • QuestionForm — viewer vs. editor role gating, delete event, options table

Enrollment & pages

  • EnrollmentList — empty state, row rendering, row click
  • Courses, Organizations, ApiKeys — full page render via Base/MenuBar with fetch mocks, role-gated buttons, dialogs

Source changes

Courses.jsx, Organizations.jsx, and ApiKeys.jsx are Django-template entry points that define a component and immediately call render({children: <Component />}) with no export. Added export default to each so tests can import the component directly — the runtime behavior is unchanged.

// Before
render({children: <Courses />});

// After
export default Courses;
render({children: <Courses />});

@payamnj payamnj marked this pull request as ready for review May 5, 2026 13:33
@payamnj payamnj merged commit 6512b75 into master May 5, 2026
8 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