-
Notifications
You must be signed in to change notification settings - Fork 33
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
(Release 1.4) Enhancing Boot Notification Service/Handler tests #223
Merged
elliot-sabitov
merged 17 commits into
rc-1.4.0
from
feature/enhancing-boot-notification-service-tests
Aug 16, 2024
Merged
(Release 1.4) Enhancing Boot Notification Service/Handler tests #223
elliot-sabitov
merged 17 commits into
rc-1.4.0
from
feature/enhancing-boot-notification-service-tests
Aug 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ls in Configuration module
…structor to take in a cache + logger to support some of the boot notification handler functionality that was moved into the service
…lity out of Configuration module's BootNotification handler to BootNotificationService + DeviceModelService to prepare for unit tests
…icationService's "cacheChargerActionsPermissions" method
…icationService's "triggerGetBaseReport" method
…d code in DeviceModelService
…ootNotificationService test
…ger set variables if pendingBootSetVariables.length > 0, rather than > 1
…able from bootWithRejectedVariables to doNotBootWithRejectedVariables for clarity
…ablesActionsAfterBoot to executeSetVariablesAfterBoot for brevity
…et variables since it's not as easy to do as initially thought
…om DeviceModelService
… as a constructor argument for BootNotificationService and instead passing it in to the relevant methods that need it + moving more cache-related calls back into the module since they're not relevant to the methods they were put into
… as a constructor argument from remaining files + adding more comments
elliot-sabitov
approved these changes
Aug 16, 2024
…cation-service-tests # Conflicts: # 03_Modules/Configuration/test/module/BootNotificationService.test.ts
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves more functionality out of the BootNotification handler in Configuration module into the BootNotificationService and adds the appropriate unit tests for the functionality that was moved
Unfortunately, there are some limitations to what can be moved out due several different
sendCall
invocations that would be messy to move into the service (such as having to pass functions as a method parameter... 😳). As a result, this PR attempts to refactor some of the immovable logic in the handler away from long if-statements to if-statements that will return right away if the logic cannot move forward. This is partly in hopes that the next refactor can take the remaining chunks and make them unit testable 🤞Points of interest regarding the aforementioned if-statement refactor:
Additionally, some if-statement logic was simplified (either by moving into a dedicated variable or unnecessary null checks removed) to aid with readability and yet again hopefully make a future developer's refactor job easier.