Confirm PackageSubmission / PackageDraftVersion is not created or modified
100%
Flow 1: pending draft clobber
If partner has a pending whole-package edit_request, then makes a cover image edit, confirm the pending draft’s stale image does not overwrite the newer image when approved (or flag if it does)
Critical path
Flow 1: audit trail
Audit record created for both set and remove; record has restaurant_id, package_id, actor, timestamp
Modal opens with correct title “Add Cover Image”, dropzone, helper text, Save disabled
QA-CI-009
UI: Edit Cover Image modal (image present)
Modal opens with correct title, “Change Image” overlay, “Remove image” link, Save enabled
QA-CI-010
UI: validation errors (cover)
Upload >10MB file → “File too large…” inline error; upload PDF → “Unsupported format…” inline error
QA-CI-011
UI: Remove confirm flow
“Remove image” → confirm modal “Are you sure…” → Remove → row label returns to “Add Cover Image”
QA-CI-012
UI: success toast
Upload → success → toast “Great success! / Your cover image is updated.”
QA-CI-013
Row action visibility by status
Active/Inactive → show Add/Edit; Pending Review/Rejected → no image action
QA-CI-014
“Created by Admin” badge + tooltip
Badge renders on Admin-created row; tooltip matches design copy
QA-CI-015
Pending draft does not clobber newer image
If partner has pending whole-package edit_request, then makes instant cover image edit, confirm the image stays as the newer version when/if the pending draft is later approved (or flag behavior)
QA-CI-016
Audit trail: record created + correct fields
Audit record has restaurant_id, package_id, actor_id, timestamp, action_type (set/remove)
Analytics events (partner_cover_image_updated, partner_cover_image_removed, partner_created_by_admin_badge_viewed) — verify they fire with correct payloads
Menu-item image edit (Flow 2) — blocked on design
Concurrency test: partner + Admin editing same image simultaneously
No new table. Extend existing HhPackage::Package factories:
# Within existing package factory
trait :with_cover_image do
cover_image { Rack::Test::UploadedFile.new(Rails.root.join('spec/fixtures/files/valid_image.jpg'), 'image/jpeg') }
end
trait :without_cover_image do
cover_image { nil }
end
trait :admin_created do
# Simulate admin-created package (no partner approval record)
after(:create) do |pkg|
# ensure no PackageSubmission with package_created_by_partner? = true exists
end
end
For FE Cypress tests, mock the endpoint responses — no backend fixture needed.
change_active behavior change — partners who could previously toggle Admin-created packages lose that ability by default. This is an intentional tightening, not a regression, but it must be explicitly communicated in release notes.
Pending-draft image clobber — if the pending edit_request in the old review flow contains a stale cover_image snapshot, it could overwrite the newer instant edit when approved. Must be tested and either fixed or flagged before launch.
Existing cover image on packages — removing the image from an existing package with active bookings should be verified to not break the booking confirmation display.
TouchWorker / search-sync — cover image changes (set/remove) must trigger the same sync paths as Admin-side edits. Verify.
i18n key collision — partnerCoverImage.* namespace should not collide with existing or future partner-portal i18n keys.