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

test: [M3-7112] - Add invoice generation tests for PdfGenerator.ts #11625

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

pmakode-akamai
Copy link
Contributor

@pmakode-akamai pmakode-akamai commented Feb 6, 2025

Description 📝

  • Add invoice generation tests for PdfGenerator.ts + refactoring, utility tests, and fixes

Changes 🔄

  • Add pdfreader dependency to parse the pdf files 📦 🧾
  • Add invoice generation unit tests 🧪
  • Add unit tests for getRemitAddress util 🧪
  • Move getRemitAddress to utils and reuse this utility in unit tests and PdfGenerator.ts
  • Fix inconsistent remit addresses from pdf footer text 🔨

Target release date 🗓️

N/A

How to test 🧪

  • Run yarn test PdfGenerator --reporter verbose
  • Ensure all tests pass
  • Ensure invoice PDF footer text displays as expected
    • Verify that the getRemitAddress utility is working correctly in the PDF footer
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support

  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@pmakode-akamai pmakode-akamai added Work in Progress Unit tests Improves unit test coverage labels Feb 6, 2025
@pmakode-akamai pmakode-akamai self-assigned this Feb 6, 2025
const remitAddress = isAkamaiBilling
? ['CA', 'US'].includes(country)
? ADDRESSES.akamai.us
: ADDRESSES.akamai.international
: ADDRESSES.linode;
const remitAddress = getRemitAddress(country, isAkamaiBilling);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the PDF footer text to ensure consistency by using the getRemitAddress utility, as the remitAddress condition at L306-310 differs from what we have here

@pmakode-akamai pmakode-akamai marked this pull request as ready for review February 6, 2025 14:35
@pmakode-akamai pmakode-akamai requested a review from a team as a code owner February 6, 2025 14:35
@pmakode-akamai pmakode-akamai requested review from carrillo-erik, hasyed-akamai, abailly-akamai and bnussman-akamai and removed request for a team February 6, 2025 14:35
@pmakode-akamai pmakode-akamai added Dependencies Pull requests that update a dependency file and removed Dependencies Pull requests that update a dependency file labels Feb 6, 2025
@pmakode-akamai pmakode-akamai force-pushed the M3-7112-add-invoice-generation-tests branch from 0ca6e41 to d2fdf3d Compare February 7, 2025 07:31
Copy link

github-actions bot commented Feb 7, 2025

Coverage Report:
Base Coverage: 78.94%
Current Coverage: 78.94%

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 500 passing tests on test run #10 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing500 Passing2 Skipped95m 17s

@pmakode-akamai pmakode-akamai added the Add'tl Approval Needed Waiting on another approval! label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add'tl Approval Needed Waiting on another approval! Dependencies Pull requests that update a dependency file Unit tests Improves unit test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants