Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

The test for analytics being disabled only verified that analytics GET routes were skipped, but didn't confirm that essential POST routes (/sign-up, /sign-in, /sign-out) remained functional.

Changes

Enhanced skips analytics routes when analytics are disabled test to verify:

  • Analytics GET routes are not registered (existing)
  • All three POST authentication routes are registered with correct paths, options, and handlers (new)
// Now verifies both what's disabled and what remains active
expect(app.get).not.toHaveBeenCalled();
expect(app.post).toHaveBeenCalledTimes(3);

const signUpRoute = app.post.mock.calls.find(([path]) => path === '/sign-up');
expect(signUpRoute).toBeDefined();
expect(signUpRoute?.[1]).toEqual(expect.any(Object));
expect(signUpRoute?.[2]).toEqual(expect.any(Function));
// Similar checks for /sign-in and /sign-out

Additional Notes

Addresses review feedback from #1802 requesting verification that core authentication functionality remains intact when analytics is disabled.

Testing Checklist

  • I tested the feature thoroughly, including edge cases
  • I verified all affected areas still work as expected
  • Automated tests were added/updated if necessary
  • Changes are backwards compatible with any existing data, otherwise a migration script is provided

Visual Changes (if applicable)

N/A - test-only changes


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: maor-rozenfeld <49363375+maor-rozenfeld@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Copilot AI changed the title [WIP] Fix issue allowing the application to run without analytics Verify non-analytics routes remain registered when analytics disabled Jan 6, 2026
Copilot AI requested a review from maor-rozenfeld January 6, 2026 12:03
@maor-rozenfeld maor-rozenfeld marked this pull request as ready for review January 6, 2026 12:03
@maor-rozenfeld maor-rozenfeld merged commit 90a7591 into make-analytics-optional Jan 6, 2026
1 of 2 checks passed
@maor-rozenfeld maor-rozenfeld deleted the copilot/sub-pr-1802 branch January 6, 2026 12:03
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