Database (DynamoDB) item tests. For the SessionItem database entity we perform:
- Check if the table is available,
- Create and fulfill database item entity,
- Put into the database table,
- Find the record using the primary key,
- Compare record fields of created item and item from database record,
- Remove the testing record from the database.
Related linear task: ENG-686
You don't need to use React.useMemo(...) here.
The useMemo() hook is helpful for maintaining referential equality so that objects will be considered "shallowly equal" (== in JS) and we can avoid re-renders. This is helpful for objects (including Map(), Set(), etc), arrays (which are objects), and functions (which are objects).
On the other hand, strings in JS are considered shallowly equal if they have the same contents, so we don't have to worry about re-renders if the "content" stays the same.
See below:
(In like C++, which you've been working w/ recently, std::strings can be allocated on the heap (unlike integers, booleans, etc) which may have been part of your reasoning that shallow equality would check reference instead of contents?)