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

feat(EMS-3344): no PDF - application submission - XLSX - buyer #2495

Merged
merged 33 commits into from
Jun 4, 2024

Conversation

ttbarnes
Copy link
Contributor

@ttbarnes ttbarnes commented May 30, 2024

Introduction ✏️

This PR updates the XLSX mapping sent during application submission so that the "Buyer" section is aligned with the latest no PDF/XLSX design:

Resolution ✔️

E2E directories

  • Split up application submission tests into new directories, for faster GHA execution and improved readability/maintainability:
    • /application-submission/business-conditions/*.spec.js
    • /application-submission/buyer-conditions/*.spec.js
    • /application-submission/export-contract-conditions/*.spec.js
    • /application-submission/policy-conditions/*.spec.js

E2E commands

  • Create new DRY cypress commands to click an "alternative currency" radio option and submit an alternative currency:
    • completeAlternativeCurrencyField
    • clickAlternativeCurrencyRadioAndCompleteCurrency
    • `clickAlternativeCurrencyRadioAndSubmitCurrency
  • Update completeBuyerSection and various other cypress commands to accept new params and conditionally submit an alternative buyer currency.

E2E test coverage improvements

  • Add new application submission E2E tests for single and multiple policies for the following scenarios:
    • Buyer fully populated with all possible conditions.
    • Exporter has a connection with buyer.
    • Exporter has traded with buyer, with outstanding payments, failed to pay on time.
    • Exporter has traded with buyer, with outstanding payments, not failed to pay on time.
    • Exporter has traded with buyer, no outstanding payments, failed to pay on time.
    • Exporter has traded with buyer, no outstanding payments, not failed to pay on time.
    • Exporter is connected with buyer and has traded with the buyer before.
    • Exporter has had credit insurance cover with the buyer before.
    • Exporter has buyer financial information.
    • Buyer "total outstanding payments" and "amount overdue" with an alternative currency.
    • Buyer "financial information” as no.

API alignments, helpers

  • Align CURRENCY and YOUR_BUYER field ID constants.
  • Align YOUR_BUYER content strings.
  • Add missing VALIDATION constants.
  • Add missing FORM_TITLES content strings.
  • Update the mapYesNoField helper function to:
    • Have object structured params.
    • Accept and return a custom defaultValue.
  • Update getPopulatedApplication helper function return a fully populated buyer (buyer relationship, buyer trading history).

API XLSX generation

  • Bump the DECLARATIONS index in TITLE_INDEXES.
  • Update XLSX_ROW_INDEXES to bump some particular indexes accordingly, depending on the conditional buyer answers.
  • Update XLSX specific content strings.
  • Update mapBuyer XLSX function and create new mapping functions to generate new answers in no PDF:
    • mapConnectionWithBuyer
    • mapBuyerTradingHistory
    • mapOutstandingPayments
    • mapPreviousCoverWithBuyer
  • Update unit tests.

Miscellaneous ➕

  • Fix some E2E linting issues.
  • Minor E2E fixture improvements.
  • Fix some typos.
  • Create new DRY application fixture, mockApplicationMinimalBrokerBuyerAndCompany.
  • Fix/update/align API buyer types.
  • Update test.yml.
  • Fix a failing date test.
  • Update some getPopulatedApplication unit tests to use toThrow()

@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes requested a deployment to qa June 4, 2024 09:15 — with GitHub Actions Abandoned
@ttbarnes ttbarnes merged commit 28d9cd5 into main-application-no-pdf Jun 4, 2024
161 checks passed
@ttbarnes ttbarnes deleted the feat/EMS-3344 branch June 4, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore documentation Improvements or additions to documentation enhancement New feature or request feature New functionality tech Technical debt/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants