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

#3738 - E2E Tests SIMS to SFAS #3847

Merged
merged 8 commits into from
Oct 29, 2024
Merged

#3738 - E2E Tests SIMS to SFAS #3847

merged 8 commits into from
Oct 29, 2024

Conversation

dheepak-aot
Copy link
Collaborator

@dheepak-aot dheepak-aot commented Oct 29, 2024

SIMS TO SFAS E2E TESTS

TEST SCENARIOS

  • Created a test to validate the file generation when there is a student data update, between the most recent bridge file date and current bridge execution date.
  • Created a test to validate no generation of bridge file, when there is an update on student data but the student does not have any submitted application.

image

New Library for mocking the current date retuned by the code

  • To mock the current date(new Date()) returned, a new library mockdate has been added.

@dheepak-aot dheepak-aot marked this pull request as ready for review October 29, 2024 07:22
Copy link
Collaborator

@bidyashish bidyashish left a comment

Choose a reason for hiding this comment

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

Nice work, added few comments for clarifications.

/**
* Add milliseconds to a given date.
* @param yearsToAdd number of years to be added.
* @param date date.
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot Oct 29, 2024

Choose a reason for hiding this comment

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

Double white space.
Same for both methods.


beforeEach(async () => {
// Reset all SFAS bridge logs.
await db.sfasBridgeLog.delete({ id: MoreThan(0) });
Copy link
Collaborator

Choose a reason for hiding this comment

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

We also use truncate for these situations, as below:

expect(footer).toBe("999000000001");
expect(studentRecord).toBe(buildStudentRecord(student));
// Check the database for creation of SFAS bridge log.
const uploadedFileLog = await db.sfasBridgeLog.findOneBy({
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have been using exists also for these types of checks.

},
);

it(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we be consistent about where the white space goes? This description was added twice. I would recommend adding to the end of the lines only.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

A great foundation for upcoming bridge file tests. Only minor comments and suggestions, hence approving it, looks good 👍

Copy link
Collaborator

@bidyashish bidyashish left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.35% ( 3692 / 16516 )
Methods: 10.33% ( 212 / 2053 )
Lines: 25.67% ( 3202 / 12475 )
Branches: 13.98% ( 278 / 1988 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 84.53% ( 1197 / 1416 )
Methods: 85% ( 119 / 140 )
Lines: 85.53% ( 1017 / 1189 )
Branches: 70.11% ( 61 / 87 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.01% ( 5571 / 8439 )
Methods: 63.3% ( 683 / 1079 )
Lines: 70.12% ( 4401 / 6276 )
Branches: 44.93% ( 487 / 1084 )

@dheepak-aot dheepak-aot added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit 81df5b5 Oct 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants