Skip to content

[tests]: isPrimary set to first collector#8235

Open
rijulpoudel wants to merge 1 commit into
mainfrom
issue-8233
Open

[tests]: isPrimary set to first collector#8235
rijulpoudel wants to merge 1 commit into
mainfrom
issue-8233

Conversation

@rijulpoudel

@rijulpoudel rijulpoudel commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8233

Summary by CodeRabbit

  • Tests
    • Added coverage for collector-related business rules, confirming that a newly added collector is automatically marked as primary when included in a collecting event.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fee13b1d-851d-4315-8eed-1651437e3f85

📥 Commits

Reviewing files that changed from the base of the PR and between 7a06d41 and 3ac03d4.

📒 Files selected for processing (1)
  • specifyweb/frontend/js_src/lib/components/DataModel/__tests__/businessRules.test.ts

📝 Walkthrough

Walkthrough

A new Collector business rule test suite is added to the business rules test file. The test initializes a CollectingEvent's collectors dependent collection with an empty array, adds a Collector, and asserts that isPrimary is automatically set to true.

Collector isPrimary Business Rule Test

Layer / File(s) Summary
Collector isPrimary test
specifyweb/frontend/js_src/lib/components/DataModel/__tests__/businessRules.test.ts
New describe('Collector business rule') block verifies that a Collector added to CollectingEvent.collectors has isPrimary set to true.

Possibly related issues

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: adding a test for isPrimary on the first collector.
Linked Issues check ✅ Passed The new test suite matches #8233 by verifying Collector.isPrimary becomes true for the first collector.
Out of Scope Changes check ✅ Passed The PR appears scoped to the requested test coverage and introduces no unrelated changes.
Automatic Tests ✅ Passed PASS: businessRules.test.ts adds an active test covering Collector.isPrimary auto-setting when added to CollectingEvent.collectors.
Testing Instructions ✅ Passed The new Collector test clearly targets CollectingEvent.collectors and verifies isPrimary auto-sets on add, matching the affected behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8233

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Unit Test: isPrimary set to first collector

2 participants