Closed (fixed)
Project:
Entity Embed
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Sep 2015 at 15:30 UTC
Updated:
18 Apr 2019 at 13:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dave reidComment #3
dave reidComment #4
wim leersSimilar to #2560787-3: Add tests for entity access.
Comment #5
wim leers#2328659: Convert all existing entity_embed tests from WebTestBase to BrowserTestBase landed, unblocking this!
Comment #6
phenaproximaHere's a basic, albeit sloppy, test. There is still a lot of clean-up needed, and I'd love to know what edge cases need to be covered as well.
Comment #7
wim leersYay, thanks for getting this started! Will review tomorrow.
Comment #8
wim leersBasically only nits!
s/$node/$host_entity/
s/$translation/$host_entity_translation/
This is a test. Tests should be as simple and readable as possible. Using APIs to compute the URL is the wrong thing to do here. Hardcoding the expected URL is perfectly appropriate.
So we can remove the 3 commented lines and the todo.
👍
This also proves that no explicit cache invalidation was necessary; thereby confirming that Entity Embed already is bubbling the appropriate cacheability! 🎉
This is missing a comment. Something like:
// Now make the Portuguese translation of the host entity use the data-langcode attribute to refer to a specific translation of the embedded entity.Nits addressed.
Comment #9
phenaproxima+1 on the cleanup. Thanks!
Comment #11
wim leersComment #13
wim leersWe missed one aspect here: if the translation for the specified
data-langcodedoes not exist. #3027445: Add tests to ensure `data-langcode` works when that translation does not exist; should fall back to default translation was filed for that edge case.