我想为window.onscroll编写测试用例。
scroll () {
window.onscroll = () => {
if (this.contentType.toLowerCase() != this.allContentTypes.all.toLowerCase()) {
if (((window.innerHeight+window.scrollY) >= document.body.scrollHeight-100) && (this.allSearchResults.length < this.searchResultsCount) && this.loading >= 0) {
this.pageNumber = this.pageNumber+1
this.getAllSearchResultForContentType()
}
}
}
},