Currently the uuid test mocks are hard coded. In order to ensures that every test is fresh and independent of each other, the proposed solution was to use beforeAll() to set up the mock. As jest.mock can't be used inside of the tests or inside beforeAll, jest.spyOn was used instead of jest.mock.
What was changed:
Hard-coded jest.mock were replaced with jest.spyOn inside the beforeAll().
The mocks were restored in afterAll().
The testing section in documentation was updated to reflect the suggested testing method.
Testing
This change was tested using:
[x] WDIO
[x] Jest
[ ] Visual testing (please attach a screenshot or recording)
[ ] Other (please describe below)
[ ] No tests are needed
Reviews
[ ] UX review
[ ] Accessibility review
[ ] Functional review
This PR is a part of following JIRA:
UXPLATFORM-9515
Summary
Currently the uuid test mocks are hard coded. In order to ensures that every test is fresh and independent of each other, the proposed solution was to use beforeAll() to set up the mock. As jest.mock can't be used inside of the tests or inside beforeAll, jest.spyOn was used instead of jest.mock.
What was changed: Hard-coded jest.mock were replaced with jest.spyOn inside the beforeAll(). The mocks were restored in afterAll(). The testing section in documentation was updated to reflect the suggested testing method.
Testing
This change was tested using:
Reviews
This PR is a part of following JIRA: UXPLATFORM-9515