Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
workflows.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2017 at 11:51 UTC
Updated:
5 Sep 2017 at 08:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sam152 commentedIf we don't want anything selected by default, we can just remove this right?
Comment #3
lendude@Sam152 yeah that should do it.
Dug around a bit but doesn't seem to be test coverage for this field having nothing selected by default.
We should probably add a line to
\Drupal\Tests\workflows\Functional\WorkflowUiTestThis seems to be all the coverage the form has at the moment, or is there some more somewhere else?
Comment #4
scott_euser commentedI think that `hasCheckedField()` would work for that. Does the attached look okay?
Comment #6
sam152 commentedThis oughta do it.
Comment #7
scott_euser commentedAh missed the session! Was about to submit this
$this->assertFalse($this->getSession()->getPage()->hasCheckedField('to'));But I see your checkboxNotChecked() also works for radios in the same way
Comment #8
scott_euser commentedComment #9
lendudeThe problem with checkboxNotChecked (aside from the confusing use on a radio button) only checks the first element with the given name (it uses find(), not findAll()). Just as a quick test, if you change the default for 'to' to 'draft', this test still passes ('published' is the first radio button for 'to').
I would go for something like:
Comment #10
scott_euser commentedRight makes sense, thanks! Took me a bit to get phantomjs working in my containers so wasn't able to test for a bit, but got it going now. Updated the patch with your above suggestion which worked for me in testing.
Comment #12
scott_euser commentedTests failure was Jenkins not able to access db. Reran and all passed.
Comment #13
lendudeLooks great now. Thanks!
Comment #14
larowlanUpdating issue credit to add @Lendude who provided reviews that shaped the final patch.
Comment #15
larowlanCommitted as 3bbf314 and pushed to 8.5.x
Cherry-picked as deaa514 and pushed to 8.4.x