Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

test: add image upload and removal on question to cypress

# The commit message ONEARMY#2 will be skipped:

# whatever
  • Loading branch information
Robert-LC authored and benfurber committed Mar 27, 2024
1 parent 77c1b80 commit 9ee0bce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/cypress/src/integration/questions/write.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ describe('[Question]', () => {
delay: 0,
})

cy.step('Add images')
cy.get('[data-cy=image-upload-0]')
.find(':file')
.attachFile('images/howto-step-pic1.jpg')
cy.get('[data-cy=image-upload-1]')
.find(':file')
.attachFile('images/howto-step-pic2.jpg')

// To do - Set categories so this can then be selected here.

cy.selectTag(tag1, '[data-cy="tag-select"]')
Expand Down Expand Up @@ -61,6 +69,11 @@ describe('[Question]', () => {
.clear()
.type(updatedQuestionDescription, { delay: 0 })

cy.step('Update images by removing one')
cy.get('[data-cy=image-upload-0]')
.get('[data-cy=delete-image]:first')
.click({ force: true })

cy.step('Submit updated question')
cy.get('[data-cy=submit]')
.click()
Expand Down

0 comments on commit 9ee0bce

Please sign in to comment.