Closed sherwinski closed 4 days ago
Even though the error occurs, the tests still pass. For that reason, I assumed it's not part of the test's expected behavior. Please feel free to correct me if my understanding there is wrong.
I was also unsure at first but I think it's part of the test's expected behaviour as discussed here: https://github.com/OneSignal/OneSignal-Website-SDK/pull/1192#pullrequestreview-2298504262
Note: If needed we can add something like expect(Log.error).toHaveBeenCalled() to ensure that we are testing for the existence of the error.
Good idea, this makes sense to do inorder to avoid confusion
Description
1 Line Summary
Explicitly tests for an error in the
registerForPush
test.Details
When running current tests, the following error is emitted:
This change adds an assertion since the error is part of the test's expected behavior.
Even though the error occurs, the tests still pass. For that reason, I assumed it's not part of the test's expected behavior. Please feel free to correct me if my understanding there is wrong.Note: If needed we can add something likeexpect(Log.error).toHaveBeenCalled()
to ensure that we are testing for the existence of the error.Systems Affected
Validation
Tests
Info
Checklist
Programming Checklist Interfaces:
Functions:
Typescript:
Other:
elem of array
syntax. PreferforEach
or usemap
context
if possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.context
Screenshots
Info
Checklist
Related Tickets
This change is