Problem/Motivation

The module currently only seems to have very basic tests, but is complex and should have tests to ensure it works as expected.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

velmir_taky made their first commit to this issue’s fork.

velmir_taky’s picture

Status: Active » Needs review

Added kernel tests for the main module functionality:

- Config entity CRUD, computed ID, display methods, field type accessors
- hook_entity_extra_field_info() for both view and form displays
- Theme suggestions hook
- Plugin manager discovery and instantiation for all 6 plugin types
- Token plugin build with different configurations
- Condition evaluation logic (all/any pass, empty conditions)

PHPStan failure is not related to this MR — those are pre-existing errors in ConfigTranslation/EntityExtraFieldMapper.php (see #3575357).

anybody’s picture

Thanks @velmir_taky, great work!

We should also have functional tests for the UI in the fields area, I think.

velmir_taky’s picture

Status: Needs work » Needs review

Thanks @anybody!

Added functional tests for the UI as you requested.
Also added FunctionalJavascript tests for the AJAX add form.
All 32 module tests pass.

Please review when you get a chance.

anybody’s picture

Assigned: Unassigned » grevil
Priority: Major » Normal
anybody’s picture

Assigned: grevil » Unassigned
Status: Needs review » Needs work

@velmir_taky would be very helpful to also have tests checking the views display of entity_extra_field with and without using arguments and tokens.

velmir_taky’s picture

Status: Needs work » Needs review

Added kernel tests for the Views plugin as requested in #8.

The new ExtraFieldViewsPluginTest covers:
- Rendering a view as an extra field without arguments
- Token-based arguments ([node:nid] resolving to the actual node ID)
- Static arguments
- Multiple comma-separated arguments (token + static combined)
- Empty view output when no results match
- Default plugin configuration

anybody’s picture

Assigned: Unassigned » grevil

Nice! Even if it's probably AI-generated (right?), it looks useful to me and covers a bunch of code. Thanks!

@grevil would you take a rough look and merge if it's fine (enough)?

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs review » Needs work
Issue tags: -Novice

Needs rebase.

grevil’s picture

Status: Needs work » Reviewed & tested by the community

LGTM, made some adjustments.

grevil’s picture

Let's wait for the tests to pass.

grevil’s picture

Status: Reviewed & tested by the community » Fixed

All green! Merging.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.