silverstripe / silverstripe-elemental

Create pages in Silverstripe CMS using content blocks
http://dna.co.nz
BSD 3-Clause "New" or "Revised" License
109 stars 115 forks source link

MNT MNT Add behat tests for related data #1180

Closed emteknetnz closed 4 months ago

emteknetnz commented 4 months ago

Issue https://github.com/silverstripe/silverstripe-elemental/issues/1170

Requires frameworktest PR to be merged first

Requires PRs on a different issue to be merged first

Main code change for this PR ended up in this different PR, so this PR is now just adding a behat test

emteknetnz commented 4 months ago

There are existing tests for:

Both of these tests validation, and also that you can save the data elsewhere in the feature file as they test for a success message. However they only has TreeDropdownField tests and not UploadField tests

I've updated everything to now also have UploadField tests

The issue this PR is connected to is about saving values, not validating them.

Yeah, as mentioned the "saving values" bit was sorted in a different PR here

This particular issue is now largely redundant because of that PR. So this PR is now just behat tests, though we should definitely still merge this so that we're consistently testing related data on all x3 ways to save a content block

GuySartorelli commented 4 months ago

Both of these tests validation, and also that you can save the data elsewhere in the feature file as they test for a success message.

I don't think just checking a success message is enough to correctly regression test the bug that this issue talks about - we need to check that the value is actually there after saving. i.e. "I select the option and I save - then I check the field has the correct value"

emteknetnz commented 4 months ago

I've added extra steps to check the that related data values were saved