Fix flaky spec caused by missing stub return value
What does this MR do?
Ensure axios.get still gives us a thenable value. I think this is due to not waiting for promises to resolve in the beforeEach/mountComponent dance, but this was the simplest solution I could think of.
Sample from ee/app/assets/javascripts/boards/components/boards_list_selector/index.js
mounted() {
this.loadList();
},
methods: {
loadList() {
// this calls axios.get()
return this.store.loadList(this.listPath, this.listType).then(() => {
this.loading = false;
});
},
What I think is happening:
- beforeEach calls mountComponent
-
this.loadList()
called (from initial mount) - test starts
- spyOn(axios, 'get')
-
this.store.loadList
calls axios.get. This returns undefined, so it errors!
Closes #196876 (closed)
Edited by 🤖 GitLab Bot 🤖