test: cover dated MSA lower bound on refresh (CM-1180)#4335
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression coverage for the dated-MSA lower boundary during affiliation refresh.
Changes:
- Seeds 20 pre-window activities.
- Verifies employer retains all 50 out-of-window activities.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (2)
services/libs/data-access-layer/src/affiliations/index.test.ts:12
- This block misstates the referenced testing ADRs. ADR-0007 explicitly prefers inline fixtures, and ADR-0008 requires named scenarios—not DB-backed tests; this suite already uses named
it(...)scenarios. Please describe the actual isolation/style difference without presenting these choices as ADR violations.
services/libs/data-access-layer/src/affiliations/index.test.ts:21 - The direct
./indeximport loads a module that importsBLACKLISTED_MEMBER_TITLESfrom../members/base, but the hoisted mock below still targets../../members/base, which does not exist from this directory. As a result, the intended stub does not intercept the dependency and the heavy real module is loaded; update the mock specifier to match the production import.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (2)
services/libs/data-access-layer/src/affiliations/index.test.ts:12
- This says the suite violates ADR-0008 because it lacks “named DB-backed scenarios,” but ADR-0008 requires named scenarios—not database-backed tests—and this file already uses named
it(...)cases. Rephrase the note without attributing the mocked-vs-DB-backed distinction to that ADR.
services/libs/data-access-layer/src/affiliations/index.test.ts:21 - The corrected
./indeximport loads../members/base, but the hoisted stub below still targets the nonexistent../../members/base. It therefore does not intercept the production dependency as the comment claims. Point the mock at the same module path used byaffiliations/index.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dateStartchecks would still pass.Test plan
pnpm --filter @crowd/data-access-layer test member-organization-affiliation(or the suite’s usual vitest target)Made with Cursor