Needs review
Project:
Multiple Value Widget
Version:
7.x-1.x-dev
Component:
Automated Testing
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2017 at 08:51 UTC
Updated:
14 Sep 2017 at 12:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
stefanos.petrakisHere is a patch for this.
Comment #3
stefanos.petrakisComment #4
ciss commentedAwesome, thanks for this! I'd suggest we add a list of test cases we want to cover to the issue summary so that we can check those off.
Since various scenarios should be covered for each widget type individually it might make sense to create a base class and extent it for each widget type. I assume you have more experience with Web test cases than I do, so that decision is yours.
Tests that I think we should cover (bucket list, not necessarily all in one go):
Comment #5
stefanos.petrakisHere is a patch that covers some of the wanted test cases (see updated OP).
This is still WIP, reviews are welcome though along the way.
Comment #6
ciss commentedThanks, this looks like a good start! What follows is a very superficial review (I didn't review the details of the individual tests). I hope to find some time to do an in-depth review later this week.
Should be protected.
Shouldn't assertions be limited to test* methods? If this is a setup method, it should probably focus on setting things up?
Why is this neccessary?
Minor nitpick: These should be single quotes.
In general all asserts should have a proper message added, and t() should not be used for assertion messages.
As discussed on IRC I still believe we should test the various widgets individually. This should also help us pinpoint and add corner cases where features are specific to a single widget type.
Comment #7
stefanos.petrakisHere is an update, based on the last very helpful review.
Regarding the 2. point about
; although this is a valid point, the practice in core is deviating from that, and for good reason I believe. For example, TranslationTestCase::addLanguage uses asserts even though it's a configuration/helper method. And I understand this, as it is also checking some hypotheses about the configuration interface and functionality. In that sense, I think assertions in our test suite may occasionally appear inside configuration/helper methods.
Regarding the
remark; I can only agree, I am wondering if we are able to do that using Simpletest; testing the Javascript rendering+functionality is not really possible using Simpletest. Thoughts?