I am splitting off an issue - to prevent to parent issue from blowing up into a unreviewable mess.
The original plan was to make the minimal changes as part of the parent issue.
but I agree with this comment.
https://www.drupal.org/node/2862510#comment-12053691
So I think these assertions should be converted to both Unit tests and Javascript tests to cover it completely.
Summarising CommandsTest::testAjaxCommands()
There are 14 assertions all of a common form
AddCssCommand - needs only a straight conversion to units test as other functional test cover the more AJAX-ey functionality
Each command should be reviewed on a case by case basis.
Comment | File | Size | Author |
---|---|---|---|
#19 | 2872603-19.patch | 17.79 KB | Lendude |
#19 | interdiff-2872603-14-19.txt | 637 bytes | Lendude |
#14 | 2872603-14.patch | 17.94 KB | Lendude |
#14 | interdiff-2872603-10-14.txt | 3.16 KB | Lendude |
#13 | drupal-split-ajax-tests-2872603-13.patch | 36.61 KB | m1r1k |
Comments
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedThe patch breaks CommandsTest into:
testAjaxCommands
-> JTB (all commands except 'alert', Selenium optionality)testAttachedSettings
-> KTBComment #5
borisson_You added new base classes as well, is there a reason why those were added with just one usecase? Are they being used in the related issue? If they aren't, I don't think we should add the base classes.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commented@borisson_, thanks for review!
I agree not to create a base classes. If they are needed in the future, we will create them in the future.
Also found easy way to test
alert()
command. So back it. Now a full replacement.As @martin107 has already pointed out, we also have Unit test coverage via AjaxCommandsTest. So, this convertion seems quite caring.
Comment #7
borisson_Comment #8
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-rolled.
Comment #9
m1r1k CreditAttribution: m1r1k commentedShould be updated because of this change record? [#2945059]
Comment #10
m1r1k CreditAttribution: m1r1k commentedHere is reroll that uses WebDriverTestBase instead of JavascriptTestBase
Comment #12
m1r1k CreditAttribution: m1r1k commentedApparently CommandsTest should be rewritten because of [#2940704]
Comment #13
m1r1k CreditAttribution: m1r1k commentedComment #14
Lendude@m1r1k thanks for working on this. Not sure what happend in #13 but that seems to contain a lot of unrelated changes. I think the patch in #10 needed some work to account for #736066: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs landing (yay!!)
So took out some of the divs from the test and some other minor clean up.
Interdiff is versus #10
Comment #16
borisson_Looks solid! Great work.
Comment #17
alexpottComment #18
alexpottThis is not doing what we want it to do :)
The only reason this doesn't fail is because of some interesting code in ::installSchema
That should also fire a deprecation message so that we don't hit this issue again in core - can someone file a follow-up?
Comment #19
Lendude@alexpott thanks! Removed the installSchema call, it's indeed not needed at all.
I think the proper handling of that piece of BC code can be done in #2670454: Deprecate individual schema install of system module in KernelTestBase, so can we call that the follow up? (looking at the number of fails there it's something that is going wrong in a large number of tests)
Comment #20
alexpott@Lendude yep that can totally be the followup.
Comment #21
borisson_Setting to RTBC based on the approval of the @alexpott in #20.
Comment #23
alexpottCommitted and pushed ccece5260a to 8.7.x and 140b01f0e9 to 8.6.x. Thanks!
Fixed unused use on commit.