Skip to content

Commit

Permalink
errors validations in pin a cid modal - test (#2235)
Browse files Browse the repository at this point in the history
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>
  • Loading branch information
juans-chainsafe and tanmoyAtb authored Aug 4, 2022
1 parent 84b396e commit e2e2daf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/storage-ui/cypress/tests/cid-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ describe("CID management", () => {
cy.web3Login({ withNewSession: true })
navigationMenu.cidsNavButton().click()

// pin a cid and see it in the pinned items table
// go to pin a cid modal and type the name
cidsPage.pinButton().click()
addCidModal.body().should("be.visible")
addCidModal.nameInput().type(testCidName)

// ensure can't pin an empty cid
// TODO: uncomment when #2229 issue is fixed
//addCidModal.pinSubmitButton().safeClick()
//addCidModal.nameInput().should("have.class", "error")

// ensure can't pin an invalid cid
addCidModal.cidInput().type("invalid cid")
addCidModal.cidInput().should("have.class", "error")
addCidModal.cidInput().clear()

// pin a valid cid and see it in the pinned items table
addCidModal.cidInput().type(testCid)
addCidModal.pinSubmitButton().safeClick()
cidsPage.cidItemRow().should("have.length", 1)
Expand Down

0 comments on commit e2e2daf

Please sign in to comment.