Verify siblings and closest ancestor elements using Cypress
Preconditions (3)
Step 1: Locate the list item with class 'active'
Step 2: Use cy.siblings() to get all sibling items of the active item
Step 3: Verify that the siblings do not have the 'active' class
Step 4: Use cy.closest() on the active item to find the container with id 'list-container'
Step 5: Verify that the closest container has the correct id
✅ Expected Result: The siblings of the active item are found and none have the 'active' class. The closest container element with id 'list-container' is correctly identified.