From fd6901011979c7d506e3a5d8cac9eaaa0a406132 Mon Sep 17 00:00:00 2001 From: Daryll Doyle Date: Mon, 30 Sep 2024 11:40:50 +0100 Subject: [PATCH] Add test for grid view uploads --- tests/cypress/e2e/safe-svg.cy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/cypress/e2e/safe-svg.cy.js b/tests/cypress/e2e/safe-svg.cy.js index 7f95718f..601ff02e 100644 --- a/tests/cypress/e2e/safe-svg.cy.js +++ b/tests/cypress/e2e/safe-svg.cy.js @@ -3,12 +3,18 @@ describe('Safe SVG Tests', () => { cy.login(); }); - it('Admin can upload SVG image', () => { + it('Admin can upload SVG image via add new media file', () => { cy.uploadMedia('.wordpress-org/icon.svg'); cy.get('.media-item .media-list-title, .media-item .title').should('exist').contains('icon'); cy.get('.media-item a.edit-attachment').should('exist').contains('Edit'); }); + it('Admin can upload SVG image via the media grid', () => { + cy.uploadMediaThroughGrid('.wordpress-org/icon.svg').then((attachmentId) => { + cy.get(`.attachments .attachment[data-id="${attachmentId}"]`).should('exist'); + }); + }); + /** * Flow for verify SVG sanitization. *