Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This is probably the most important part of this module and yet we don't test it at all.
Proposed resolution
Add test for "multiple" widget. Check:
- if form inline form appears when field is empty
- if creation of entities works
- values of created entity
- if validation kicks in in case of errors
- if correct fields appear in the table
- if edit and remove buttons appear
- if editing entities work
- if removing entities work
- if referencing existing entities work
- if widget respects configuration (labels, reference existing, create new)
- if widget respects cardinality settings
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff.txt | 21.64 KB | slashrsm |
#9 | 2512678_9.patch | 26.61 KB | slashrsm |
#6 | write-tests-for-ief-multiple-field-widget-2512678-6.patch | 28.85 KB | dbolinovski |
Comments
Comment #1
slashrsm CreditAttribution: slashrsm commentedComment #2
slashrsm CreditAttribution: slashrsm commentedComment #3
slashrsm CreditAttribution: slashrsm commentedComment #4
slashrsm CreditAttribution: slashrsm commentedComment #5
woprrr CreditAttribution: woprrr as a volunteer commentedThanks for this task slashrsm; I tried to help you in this task ;) I follow.
Comment #6
dbolinovski CreditAttribution: dbolinovski commentedThis is partially done. What is left:
- if validation kicks in in case of errors
- if widget respects configuration (labels, reference existing, create new)
- if widget respects cardinality settings
The test fails on deleting the node from the system, this can be an issue.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedComment #8
slashrsm CreditAttribution: slashrsm at Examiner.com commentedThis is amazing! I am very excited about this test as it is testing the most important part of this module. I have few comments, but they're mostly of cosmetic nature.
Would be nice to have meaningful messages associated with all asserts.
Applies to the entire test.
Comment should end with a period. Applies to the entire patch.
This comment seems strange. We should have meaningful first line and further explanation below it.
No need to initialize empty array as we re-initialize it few lines below.
We can probably simplify this to
Same as above (no need to init empty array).
I think we shouldn't use __toString() directly. We can simply cast I believe. Applies to the entire patch.
Let's make lines in comments 80 chars long.
. should have space on both sides. Applies to the entire patch.
Is this working as expected? Shouldn't we pass entity ID in the parenthesis?
Description should be in next line.
I think it would make sense to create base class for IEF tests and move helper functions in there (createReferenceContent(), setAllowExisting() and getButtonName()).
Comment #9
slashrsm CreditAttribution: slashrsm at Examiner.com commented#8 fixed and chasing rename from multiple to complex.
Comment #11
slashrsm CreditAttribution: slashrsm at Examiner.com commentedCommitted. @dbolinovski++
Comment #12
axe312 CreditAttribution: axe312 at Wunder commentedI am missing tests for IEF forms within IEF forms. Especially when opening multiple ief forms at once it seems to cause problems like the form is replaced with another one or validation kicks in for another one.
Let me know if i can help :)
Comment #13
slashrsm CreditAttribution: slashrsm as a volunteer commentedSure. Any improvements to tests are welcome. Feel free to open a new issue for that.
Issues with multiple IEF forms sound like a bug. Should we open a bug report for those too?
Comment #14
axe312 CreditAttribution: axe312 at Wunder commentedI am currently preparing a demo to demonstrate all bugs. Will update you later on.