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

Stabilise spec by not relying on record ids #12738

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Aug 6, 2024

What? Why?

Fixing tests on:

A spec was referring to and input id:

"order_cycle_incoming_exchange_0_variants_#{new_product.variants.first.id}"

But sometimes the exchange would have the id 1 instead of 0 and the test would fail. Instead I opted to select the field by text visible to the user.

What should we test?

  • Specs only.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

A spec was referring to and input id:

```
"order_cycle_incoming_exchange_0_variants_#{new_product.variants.first.id}"
```

But sometimes the exchange would have the id 1 instead of 0 and the test
would fail. Instead I opted to select the field by text visible to the
user.
@mkllnk mkllnk added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Aug 6, 2024
@mkllnk mkllnk self-assigned this Aug 6, 2024
@mkllnk mkllnk marked this pull request as ready for review August 6, 2024 04:15
Comment on lines +49 to +51
within("div.exchange-product", text: "Z Last Product") do
expect(page).to have_checked_field "1g", disabled: false
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, thanks for updating the spec to use observable facts! ❤️

@rioug rioug merged commit 6139ba3 into openfoodfoundation:master Aug 6, 2024
53 checks passed
@mkllnk mkllnk deleted the flaky-exchange-id branch August 22, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants