Skip to content

Commit

Permalink
Merge pull request #24 from kanopi/bug/3419010-mediaLibraryAdd
Browse files Browse the repository at this point in the history
mediaLibraryAdd incorrectly assumes the image field is field_media_image
  • Loading branch information
thejimbirch authored Feb 3, 2024
2 parents 7e00114 + 57f69be commit bc5c1d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mediaLibraryAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Cypress.Commands.add("mediaLibraryAdd", (selector, fileName, type="") => {

// Basic check if the file is an image so we know if we have to add some alt tags.
if (fileName.includes(".png") || fileName.includes(".jpg")) {
cy.get('input[name="media[0][fields][field_media_image][0][alt]"]').type('alt text');
cy.get('.media-library-add-form').contains('Alternative text').next().type('alt text');
}

// Select the uploaded file.
Expand Down

0 comments on commit bc5c1d7

Please sign in to comment.