Skip to content

Unit tests for canEditProject #107

Description

@geetxnshgoyal

What

canEditProject in lib/projects.ts decides who may edit a project in the portal.

There are no tests for it yet.

Cover at least

  • the owner can edit
  • a collaborator can or can't edit, depending on what the code says (document which)
  • an unrelated member can't
  • an admin can (read the function to see how it takes the member and project)

How

  • Create lib/projects.test.ts next to the code. Follow the style of lib/github-auth.test.ts.
  • Run npm test. Then break the code on purpose (flip a condition) and watch at least one of your tests fail. Paste that failure output in the PR description, then undo the break.
  • Test behaviour through the exported function only. Don't change the source file unless you find a bug, and if you do, stop and comment on this issue first.

Size: ~30–60 lines of tests, 0 lines of source.


Taking this? Comment /assign and the bot assigns you if it's free. One issue per person at a time; comment /unassign to hand it back. That's milestone 2 of the 10 PR Journey. Setup, the checks CI runs, and how to open the PR from your fork are in CONTRIBUTING.md. Put Fixes #<this issue> in your PR description.

Activity

  1. PrinceCodes07-eng commented on Sep 22, 2026

    @PrinceCodes07-eng

    /assign

  2. github-actions commented on Sep 22, 2026

    @github-actions

    @PrinceCodes07-eng it's yours! 🎉

    1. Fork the repo and create a branch: see CONTRIBUTING.md.
    2. Open your PR from your fork into main, with Fixes #107 in the description.
    3. Make sure CI (Lint, Test, Type-check & build) is green.

    Can't finish it? Comment /unassign so someone else can pick it up.

  3. adhithyapandiri-a11y commented on Oct 5, 2026

    @adhithyapandiri-a11y
    Contributor

    /assign

  4. github-actions commented on Oct 5, 2026

    @github-actions

    @adhithyapandiri-a11y this one is already taken by @PrinceCodes07-eng. Pick another from the unassigned good first issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions