Metadata Display Component: Test Cases & Utility Placement
TL;DR
- Wrote test cases for metadata display component behavior
- Tests cover date formatting, undefined field handling, empty metadata state, and updated-at field logic based on created/updated equality
- Also test icon display when none specified
- Unsure where utility functions should live, so left them collocated with the code being worked on
Test Cases
sprintf(s__(“AiCatalog|This %{itemType} doesn’t have any metadata.”), { itemType })
- should Display the correct date format
- Should not display a line item when that field value is undefined
- Should display the no metadata text when there are no med fields available
- Should not display the updated at field when merge created updated if equal is true, and the created an updated at dates are the same
- Should display the updated at field when merge created updated if equal is false in all cases
- Displays an icon when none are specified
Not Sure
I’m not entirely sure where the utility functions I’ve created should live, so for now I’ve kept them roughly collocated with the code I was working on.
ryer.io