I need your help. I am trying to assert the existence of a word in an array with cypress. There is an array with the names of music categories, and I should assert the result's title is included in that category. but after running I am getting this cypress error: "assert expected [ Array(1) ] to include Pop Music". I really can not find out what is the problem here. Thank you in advance
const allMusicTypes = []
cy.get('.musicCategories')
.find(selectors.CategoryList + '> a')
.invoke('text')
.then((text) => allMusicTypes.push(text.trim()))
.then(() => {
cy.get(selectors.results)
.find('button')
.click()
cy.get('.infobox')
.find('dd')
.first()
.invoke('text')
.then((categoryType) => {
const resultMusicType = categoryType.split(',')[0]
expect(allMusicTypes).to.include(resultMusicType.trim())
})