Skip to content

[test]: verify independent resource field changes propagate needsSave…#8259

Merged
rijulpoudel merged 1 commit into
issue-8241-2from
issue-8249-2
Jul 8, 2026
Merged

[test]: verify independent resource field changes propagate needsSave…#8259
rijulpoudel merged 1 commit into
issue-8241-2from
issue-8249-2

Conversation

@rijulpoudel

@rijulpoudel rijulpoudel commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8249

Summary by CodeRabbit

  • Tests
    • Added coverage for saving a record that includes an independent related subview.
    • Verified that editing the related child record marks the parent as needing save.
    • Confirmed the save completes successfully, clears the pending-save state, and preserves the child’s changes in memory.

@coderabbitai

coderabbitai Bot commented Jul 6, 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: c42175a7-b2a9-48f3-beb4-77392c2f45b7

📥 Commits

Reviewing files that changed from the base of the PR and between c9eab50 and ec0fa8d.

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

📝 Walkthrough

Walkthrough

This change adds a new test suite to resourceApi.test.ts covering the save flow for a base record with an independent subview. It introduces a helper to mock fetch/update calls and verifies needsSaved propagation and persistence of child field changes after save.

Changes

Independent Subview Save Test Coverage

Layer / File(s) Summary
Independent subview save test
specifyweb/frontend/js_src/lib/components/DataModel/__tests__/resourceApi.test.ts
Adds a setupParentWithIndependentCollection helper and a test suite that mocks parent/independent subview AJAX calls, edits a field on the independent child, and asserts needsSaved becomes true then clears after save() while the child's change is preserved.

Related issues: #8249 — verify independent resource field changes propagate needsSaved and persist after save.

Suggested labels: tests

Suggested reviewers: none identified from provided context

Ode to a tiny test, so neat 🐇
Independent fields now get their due
needsSaved rises, then clears clean
Save preserves what the child knew

🚥 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 describes the added test for independent resource field changes and save propagation.
Linked Issues check ✅ Passed The new test covers issue #8249 by verifying needsSaved is set and the independent field change survives save.
Out of Scope Changes check ✅ Passed The change is limited to a test addition directly aligned with the stated issue and objectives.
Automatic Tests ✅ Passed The PR adds an automated test in resourceApi.test.ts covering the independent subview save flow.
Testing Instructions ✅ Passed The new resourceApi test targets independent CollectionObject subviews on Accession, covering needsSaved propagation and post-save preservation as intended.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8249-2

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.

@CarolineDenis

Copy link
Copy Markdown
Contributor

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@rijulpoudel rijulpoudel requested a review from CarolineDenis July 6, 2026 16:24
@rijulpoudel rijulpoudel merged commit eca3c00 into issue-8241-2 Jul 8, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board Jul 8, 2026
@rijulpoudel rijulpoudel deleted the issue-8249-2 branch July 8, 2026 18:04
@CarolineDenis CarolineDenis added this to the 7.12.1 milestone Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

2 participants