Test Plan: Edit Attachment.
1. Test Scenarios
A. Editing Attachments in Posts
Adding Attachments
Verify that new attachments can be added during post editing via file dialog and drag-and-drop.
Confirm drag-and-drop behavior restricts the overlay to the editing input area.
Removing Attachments
Validate that attachments can be removed by clicking the delete icon and are only deleted upon saving changes.
Verify the behavior when the user cancels the edit without saving.
Saving Changes
Ensure added or removed attachments are correctly reflected in the post after saving.
B. Edit History Updates
Display of Files
Verify the UI displays file metadata (name, MIME type, size) in the edit history for all revisions, including soft-deleted files.
File Download
Validate file downloads for current and older revisions of posts through the edit history UI.
Mobile Edit History
Confirm that mobile apps do not yet support edit history, as per the specifications.
C. API Updates
Patch and Update APIs
Confirm behavior when file IDs are
nil
(no change) or notnil
(determine added/deleted files).Validate soft deletion of file entries in the database for removed files.
Ensure post versions correctly reference the associated files.
Edit History API
Verify it includes file metadata for all revisions, including soft-deleted files.
WebSocket Events
Validate that WebSocket events accurately reflect added/removed file metadata.
D. File Retention and Restoring
Public Links
Confirm that public file links cease to function when the file is removed.
E. Platform-Specific Tests
Desktop
Test drag-and-drop and attachment editing across contexts (channel, RHS, threads).
Verify responsive UI and proper save/cancel behavior.
Mobile
Validate file attachment options in the edit state and confirm correct save/cancel behavior.
Browser
Ensure consistent functionality with desktop, including drag-and-drop and WebSocket updates.
2. Test Environments
Browser: Latest versions of Chrome, Firefox, Safari, and Edge.
Desktop: Windows 10/11, macOS Ventura/Monterey.
Mobile: Android (minSdkVersion 24), iOS (latest versions).
3. Testing Types
Functional Testing
Validate all attachment editing features.
Confirm API responses for patch/update and edit history endpoints.
UI/UX Testing
Verify visual and interaction fidelity against the provided Figma designs.
Ensure drag-and-drop and file input options behave intuitively.
Regression Testing
Check unrelated post editing and file upload workflows for potential regressions.
4. Test Data
Posts with and without attachments.
Various file types (e.g., images, documents) and sizes.
Posts edited within and beyond the allowed edit time window.
Existing E2E Tests
Message edit Post History :https://github.com/mattermost/mattermost/blob/ba6b97fb6264936e5ca0bf27d6ad4401ef0b4d5b/e2e-tests/cypress/tests/integration/channels/messaging/message_edit_post_history_spec.ts
Edit Post with Attachment: https://github.com/mattermost/mattermost/blob/ba6b97fb6264936e5ca0bf27d6ad4401ef0b4d5b/e2e-tests/cypress/tests/integration/channels/messaging/message_edit_post_with_attachment_spec.js