Open Simonpedro opened 1 month ago
@dgalarza What you think of this?
Reminder we discussed this in Slack here: https://buoy-software.slack.com/archives/CLF46S290/p1710945816631299?thread_ts=1710945105.946749&cid=CLF46S290. Option 2 messes up stacktraces on failures, so 3 is best I think!
I’m also in favor of option 3.
So far I've seen three different ways in which we test the Rails implementation of a feature that already exists in React, and it'd be nice if the reach consensus on the preferred approach.
Copying and pasting all "React" specs for Rails, either in the same spec file or in a new one
Iterate two times over [true, false]
Use shared examples and use it twice, with the feature flag enabled and disabled
I think both 2) and 3) are superior to 1) since in 1) there is more risk of missing coverage when copy and pasting the specs. In 2) and 3) any missing coverage becomes more visible, as well as any future changes on the spec (because of new requirements).
A nice side effect of approaches 2) and 3) is that it forces the developer to write specs from the user's point of view, relying more in accessible items like text, labels, legends, etc.
Lastly, I think 3) is superior to 2) since it's possible to run one branch (let's say the Rails one) and not the other.