Skip to content

Add organization service lifecycle and uniqueness-constraint tests in src/services/organization.test.ts #731

Description

@1nonlypiece

📌 Description

src/services/organization.ts has no dedicated test coverage. Org creation,
rename, slug/name uniqueness, and deletion underpin the entire multi-tenant
model, yet none of these paths are exercised by a test, so a uniqueness or
cascade regression could ship silently.

This issue adds lifecycle and constraint tests for the organization service.

Goal: verify org creation, uniqueness constraints, and deletion cascade
behaviour for src/services/organization.ts.

🎯 Requirements and Context

  • Must assert name/slug uniqueness is enforced (duplicate rejected).
  • Must cover deletion cascade or soft-delete behaviour as implemented.
  • Must cover invalid-input rejection paths.
  • Must run against the test DB harness.

🛠️ Suggested Execution

1. Fork the repo and create a branch

git checkout -b test/organization-service-lifecycle

2. Implement changes

  • Add src/services/organization.test.ts.

3. Test and commit

  • Run with bun test.
  • Cover edge cases: duplicate name, rename collision, delete cascade, invalid
    input.

Example commit message

test: organization service lifecycle and uniqueness tests

✅ Guidelines

  • Minimum 95% test coverage on the new/changed lines.
  • Clear, reviewer-friendly documentation.
  • No regressions on existing organization behaviour.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing · area-backend · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the Disciplr contributor Discord to coordinate, ask questions, and get
    unblocked fast: https://discord.gg/xvNAvMJf
  • Please introduce yourself in the channel before you start so we can avoid
    duplicate work, pair you with a reviewer, and get your PR merged quickly.
  • Maintainers actively triage this channel and aim for fast, clear, respectful
    reviews — reach out any time you're blocked.

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaignMAYBE REWARDEDEligible for GrantFox rewardOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programarea-backendBackend / API worktype-testingTests and test coverage

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions