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

UIE-206 App Startup - unit tests pt1 #5246

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

msilva-broad
Copy link
Contributor

@msilva-broad msilva-broad commented Feb 6, 2025

Jira Ticket: https://broadworkbench.atlassian.net/browse/UIE-206

Summary of changes:

What

  • add unit test coverage to app startup flow initiated from appLoader.js by having the flow use callable functions which are unit-testable versus the module-scope auto-executed logic previously in place.
  • moved startup related bits to new src/libs/startup area, including our old friend ajax.ts, which is now ajax-test-root.ts.
  • added unit test coverage to moved bits.
  • also removed some orphaned src/libs/ajax module mocks (which were no-ops now anyway)

Why

  • improve code maintainability

Testing strategy

@msilva-broad msilva-broad force-pushed the msilva/UIE-206_startup-unit-tests_pt1 branch from a26a40a to 055818d Compare February 10, 2025 20:03
- initial code shift to callable (and testable) functions.
- added unit test coverage and light ts conversions.
- removed ajax module mocks that somenow snuck back into some other test files.
- removed one last orphaned ajax module mock.
import('src/libs/axe-core');
}
});
doAppLoad();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all the logic above got moved to a unit-testable function in src/libs/startup/app-loader.ts

@msilva-broad msilva-broad changed the title UIE-204 App Startup - unit tests pt1 UIE-206 App Startup - unit tests pt1 Feb 10, 2025
@msilva-broad msilva-broad marked this pull request as ready for review February 11, 2025 12:52
@msilva-broad msilva-broad requested a review from a team as a code owner February 11, 2025 12:52
@LizBaldo
Copy link
Collaborator

I was able to create / delete a Galaxy app when testing, only found a small type, :shipit:

@@ -100,3 +100,17 @@ describe('makeSuccess', () => {
expect(responseBody).toEqual({ message: 'Success' });
});
});

describe('mountAjaxOverrideUtils', () => {
it('mounts uitls for use by end2end tests', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

small nit, utils

@msilva-broad msilva-broad added this pull request to the merge queue Feb 12, 2025
Merged via the queue into dev with commit e64200b Feb 12, 2025
11 checks passed
@msilva-broad msilva-broad deleted the msilva/UIE-206_startup-unit-tests_pt1 branch February 12, 2025 16:54
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.

5 participants