Skip to content

test: cover dated MSA lower bound on refresh (CM-1180)#4335

Merged
skwowet merged 4 commits into
mainfrom
test/CM-1180-dated-msa-window-bounds
Jul 13, 2026
Merged

test: cover dated MSA lower bound on refresh (CM-1180)#4335
skwowet merged 4 commits into
mainfrom
test/CM-1180-dated-msa-window-bounds

Conversation

@skwowet

@skwowet skwowet commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to test: cover member organization affiliations (CM-1180) #4327: the dated-MSA refresh case only seeded activities inside and after the window, so removing dateStart checks would still pass.
  • Add a pre-window activity batch and include it in the employer count so both MSA boundaries are locked.

Test plan

  • pnpm --filter @crowd/data-access-layer test member-organization-affiliation (or the suite’s usual vitest target)
  • Confirm sponsor stays at 40 (in-window) and employer is 50 (20 pre + 30 post)

Made with Cursor

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 13, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings July 13, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 13, 2026 17:09
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ./index import loads a module that imports BLACKLISTED_MEMBER_TITLES from ../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.

Copilot AI review requested due to automatic review settings July 13, 2026 17:13
@skwowet skwowet merged commit 88abe24 into main Jul 13, 2026
13 checks passed
@skwowet skwowet deleted the test/CM-1180-dated-msa-window-bounds branch July 13, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ./index import 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 by affiliations/index.ts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants