concept App in category javascript
appears as: App

This is an excerpt from Manning's book Testing JavaScript Applications.
Start by updating
updateItemListso that it stores the object passed to it under theinventorykey inlocalStorage. BecauselocalStoragecan’t store objects, you’ll need to serializeinventorywithJSON.stringifybefore persisting the data.Listing 6.48. domController.js
// ... const updateItemList = inventory => { if (!inventory === null) return; localStorage.setItem("inventory", JSON.stringify(inventory)); #1 // ... }
Figure 8.2. The coverage of a test which renders
App, interacts with its child form, and verifies the item list’s elements.![]()