Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to.have.ordered.members #1151

Closed
kemalbayar opened this issue Jan 5, 2018 · 3 comments
Closed

to.have.ordered.members #1151

kemalbayar opened this issue Jan 5, 2018 · 3 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@kemalbayar
Copy link

kemalbayar commented Jan 5, 2018

Test code:

const listTypes = ['Static', 'Statistical', 'State Tracker', 'LDAP/AL']

//Type selection and check if default list types exists
        cy.get('#type_selection').click()
        cy.get('.select2-results div').should(function($divs) {
            var arrayOfDivs = $divs.map(function (i, el) {
               return Cypress.$(el).get(0).innerText //instead can be used Cypress.$(el).text()
            })
            var arrayOfDivs = arrayOfDivs.get() //convert jquery object to an array (by overwriting / redefining)
            expect(arrayOfDivs).to.have.ordered.members(listTypes, 'Check the List Types')
        })

When I run the test...

Console Output:
Error:     CypressError: Timed out retrying: Cannot read property 'members' of undefined

I also check if the Divs innerText order are the same as listTypes variable and saw no problem

@bahmutov
Copy link
Contributor

bahmutov commented Jan 5, 2018

Interesting, do other assertions on the arrayOfDivs like length work?

@brian-mann
Copy link
Member

brian-mann commented Jan 5, 2018

This is part of chai 4.0, and we use 3.5.0. There were a bunch of breaking changes bumping up to 4 and chai changed the way they did plugins as well.

I would close this issue and open a new one that just asks to update chai. This isn't really a bug.

@jennifer-shehane
Copy link
Member

Opened issue for Chai update to 4.0 here: #1153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants