Use axios MockAdapter history in JavaScript tests
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Label this issue](https://contributors.gitlab.com/manage-issue?action=label&projectId=278964&issueIid=21663) - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=21663) </details> <!--IssueSummary end--> After https://github.com/ctimmerm/axios-mock-adapter/pull/124 has been merged, we can replace ```javascript spyOn(axios, 'get'); // ... expect(axios.get).toHaveBeenCalled(); ``` with ```javascript const getCalls = axiosMock.history.find(config => config.method === 'GET'); expect(getCalls.length).toBe(1); ``` or even ```javascript const axiosCalls = axiosMock.history.find(config => config.method === 'GET' && config.url === 'http://expected.url'); expect(axiosCalls.length).toBe(1); ```
issue