Skip to content

E2E delete item test is unstable #61

@mansn

Description

@mansn

This test is unstable ("can delete an item") : https://github.com/weaddquality/business-model-canvas/blob/master/cypress/tests/e2e/details.cy.js#L129

The test fails if there are more than 1 item in the list.
This is due to the logic which determines which item that should be rendered after the current selected item has been deleted.

How can we solve this? These are the options I see right now:

Option 1 (not optimal)
Add a conditional check..
.. to check if the created item is the last one in the list,
.. and to check if there are any items left in the list,
and then we assert the 'active' attribute based on the above,
This is a bad solution though. Conditional testing sucks.

Option 2 (more stable, but will clear the current block data, including real data)
Clear the whole block before starting the test, and then prepare test data.
This gives us much better control of the state before the test starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions