You'll want to find the list and use the
have.length Cypress method to test how many items are in the list:
Something like this:
cy .get('ul') .find('li') .should('have.length', 4);
This would grab your
<ul> list and assert that there are
<li> elements in the list.
Read more about the length property here: https://docs.cypress.io/guides/references/assertions#Length.