Add helpers for HTML fixtures to Jest
What does this MR do?
Provides helper functions to load HTML fixtures in Jest tests similar to Karma.
What are the relevant issue numbers?
closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57998
Before
FAIL spec/frontend/pages/admin/abuse_reports/abuse_reports_spec.js
● Abuse Reports › encountered a declaration exception
ReferenceError: preloadFixtures is not defined
15 | $messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first();
16 |
> 17 | preloadFixtures(FIXTURE);
| ^
18 |
19 | beforeEach(function() {
20 | loadFixtures(FIXTURE);
at Suite.preloadFixtures (spec/frontend/pages/admin/abuse_reports/abuse_reports_spec.js:17:3)
at Object.describe (spec/frontend/pages/admin/abuse_reports/abuse_reports_spec.js:5:1)
(https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/186304544)
After
PASS spec/frontend/pages/admin/abuse_reports/abuse_reports_spec.js
(https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/186315765)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Inactive Account