-
Notifications
You must be signed in to change notification settings - Fork 14
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
#1864 - MSFAA Send File E2E Test Automation #1905
#1864 - MSFAA Send File E2E Test Automation #1905
Conversation
...sumers/src/processors/schedulers/esdc-integration/msfaa-integration/_tests_/msfaa-factory.ts
Outdated
Show resolved
Hide resolved
...nsumers/src/processors/schedulers/esdc-integration/msfaa-integration/_tests_/msfaa-helper.ts
Outdated
Show resolved
Hide resolved
...ntegration/msfaa-integration/_tests_/msfaa-part-time-process-integration.scheduler.models.ts
Outdated
Show resolved
Hide resolved
...packages/backend/apps/queue-consumers/test/helpers/testing-modules/testing-modules-helper.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @andrewsignori-aot 👍 Added some minor comments
gender: string; | ||
maritalStatus: RelationshipStatus; | ||
addressLine1: string; | ||
addressLine2: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can be test scenarios but not necessarily E2E scenarios. The idea is to have some E2E and focus more on the unit tests for the queue consumers, as per my understanding, to compensate also the decision to have E2E running sequentially.
newMSFAANumber.dateRequested = null; | ||
newMSFAANumber.dateSigned = null; | ||
newMSFAANumber.serviceProviderReceivedDate = null; | ||
newMSFAANumber.cancelledDate = null; | ||
newMSFAANumber.newIssuingProvince = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I feel like this logic can be kept inside the factory createFakeMSFAANumber
based on an optional parameter provided to the factory. As it is setting bunch of values to null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It follows the idea of having the factory create the record and adjust the test as needed.
Keep in mind that these "nulls" are also set once inside a "factory".
Is the idea to create options like "pending", "canceled", or "signed" states?
...egration/msfaa-integration/_tests_/msfaa-part-time-process-integration.scheduler.e2e-spec.ts
Show resolved
Hide resolved
...egration/msfaa-integration/_tests_/msfaa-part-time-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...egration/msfaa-integration/_tests_/msfaa-part-time-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
* part of the MSFAA file generation. | ||
* @param db data source helper. | ||
* @param msfaa test input data. | ||
* @returns a saved MSFAA record that used th input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please correct the return comment to "@return a saved MSFAA record that uses the input test data to be created."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"test:e2e:queue-consumers": "npm run migration:run && cross-env ENVIRONMENT=test jest --collect-coverage --verbose --config ./apps/queue-consumers/test/jest-e2e.json --forceExit", | ||
"test:e2e:queue-consumers:local": "cross-env ENVIRONMENT=test jest --verbose --config ./apps/queue-consumers/test/jest-e2e.json --forceExit", | ||
"test:e2e:queue-consumers": "npm run migration:run && cross-env ENVIRONMENT=test jest --collect-coverage --verbose --config ./apps/queue-consumers/test/jest-e2e.json --runInBand --forceExit", | ||
"test:e2e:queue-consumers:local": "cross-env ENVIRONMENT=test TZ=UTC jest --verbose --config ./apps/queue-consumers/test/jest-e2e.json --runInBand --forceExit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Looks good!
@@ -11,7 +11,7 @@ import { | |||
overrideImportsMetadata, | |||
} from "@sims/test-utils"; | |||
import * as Client from "ssh2-sftp-client"; | |||
import { createMock } from "@golevelup/ts-jest"; | |||
import { DeepMocked, createMock } from "@golevelup/ts-jest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, createMock<Client>();
is a helper to do a "deep" mock.
Thanks for setting up the E2E tests for file integration. Added few minor comments/questions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the code change and the walk through. LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @andrewsignori-aot 👍
@@ -102,7 +104,7 @@ export class MSFAARequestProcessingService extends ESDCFileHandler { | |||
const msfaaNumberRepo = entityManager.getRepository(MSFAANumber); | |||
this.msfaaNumberService.updateRecordsInSentFile( | |||
msfaaRecordIds, | |||
getUTCNow(), | |||
processDate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work @andrewsignori-aot
getUploadedFile
to allow access to the supposed-to-be uploaded file.saveMSFAATestInputData
) to generate the MSFAA records that could be used for all the MSFAA file-related tests.processDate
used for MSFAA records, MSFAA file name, and MSFAA sequence group.getPendingMSFAARequest
to ensure that the records are consistently retrieved in the same order and as a consequence, the file records will be generated using the same order also.createE2EDataSources
to be used specifically for E2E tests and reduce the amount of code needed when saving to DB multiple entities. The intention is to be used as below. Open for discussions and opinions.This is related to the idea shared on the DEVs chat on April 11th