Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aaronschachter/0a03ffd8326a5a4dbb30cedff2c89484 to your computer and use it in GitHub Desktop.

Select an option

Save aaronschachter/0a03ffd8326a5a4dbb30cedff2c89484 to your computer and use it in GitHub Desktop.
Manual testing steps for CMS alt text updater DDA migration (CONT-5978)
# Manual Testing: CMS Alt Text Updater DDA Migration
## What changed
`RecommendationCmsItemAltTextUpdater` now reads via `CMSItemService.getItems` and writes via `CMSItemService.patchItems` instead of the legacy `getCMSItems`/`updateCMSItemPartial` path.
## Automated coverage
- **Unit tests** (`cmsItemAltTextUpdater.test.ts`): cover all field types (ImageRef, MultiImage, RichText node array, RichText HTML), error handling, and patchItems error propagation
- **Integration test** (`cmsItemAltTextUpdater_test.ts`): exercises a real ImageRef field update against both storage layers (Mongo and PG)
## How to test manually
The alt text updater is invoked through the AEO Recommendations panel in the Designer when applying an `asset_alt_text_required` recommendation on a CMS image.
### Prerequisites
- `ff-aeo-site-audit` feature flag enabled for your user/site
- Site on a plan with `ALLOW_AEO_RECOMMENDATIONS` entitlement
- AI toggle enabled on the site
- `read`/`manage` permission on `siteAeoRecommendations`
### Steps
1. Start local stack (HUD: server, mongo, redis)
2. Open a site in the Designer that has a CMS collection with an ImageRef field containing an image with missing or placeholder alt text
3. Enter the Optimization workflow in the Designer (this opens the AEO recommendations panel)
4. Find an `asset_alt_text_required` recommendation that targets a CMS image (has `collection.itemId` and `collection.fieldSlug`)
5. Click Apply on the recommendation
6. Verify the CMS item's image field was updated with the proposed alt text (check in the CMS panel or via the Data API)
### What to look for
- The update should succeed without errors
- The alt text should be persisted on the correct field of the correct item
- No collection or database fetch errors (the new path doesn't need to fetch these, unlike the legacy path)
- If `patchItems` returns validation errors, the caller should surface `{success: false}` (not silently succeed)
## Note
This feature doesn't currently have Cypress E2E coverage. The AEO Recommendations team should consider adding a Cypress spec that exercises the apply-recommendation flow for CMS images, which would cover both this DDA migration and future changes to the applier/updater chain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment