Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AXON-46] chore: add unit tests for auth strategies #115

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

sdzh-atlassian
Copy link
Member

What is this?

When working on the other auth stuff, I've come to the point of doing a pretty big change around strategy.ts

To minimize the risk of breaking thing, I'm first creating a bunch of unit tests for the existing logic with minimal changes.

The original plan was to literally touch nothing and only add tests, however there are some small necessary changes:

  • encryption-related stuff is moved out of strategy.ts to a separate file strategyCrypto.ts - primarily because it caused issues with jest for some reason
  • created trivial functions for verifier and basic auth
  • bumped @types/jest version and added @jest/globals to resolve the weird it.each issue

Despite lots of logic, these things are effectively data classes, so I'm only testing the happy path to make sure the output doesn't change accidentally down the line

How was this tested

  • npm run test # OK
  • Ran authentication to Jira and BB-prod

(to avoid creating problems when changing this code)
@bwieger-atlassian-com
Copy link
Collaborator

LGTM, and we can use this dashboard to track if this has negative impact: https://app.amplitude.com/analytics/atlassian/chart/z676btcj

@sdzh-atlassian sdzh-atlassian merged commit 14ef897 into main Feb 13, 2025
2 checks passed
@sdzh-atlassian sdzh-atlassian deleted the AXON-46-auth-strategy-tests branch February 13, 2025 19:22
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