Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
asnaith committed Sep 11, 2023
1 parent c44bde9 commit 065f309
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/ui/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
specPattern: "cypress/tests/**/*.cy.{js,jsx,ts,tsx}",
specPattern: 'cypress/tests/**/*.cy.{js,jsx,ts,tsx}',
setupNodeEvents(on, config) {
// implement node event listeners here
}
Expand Down
3 changes: 0 additions & 3 deletions packages/ui/cypress/support/page-objects/landing.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ui/cypress/support/page-objects/landingPage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const landingPage = {
watchAccountButton: () => cy.get("[data-cy=button-watch-address]")
watchAccountButton: () => cy.get('[data-cy=button-watch-address]')
}
3 changes: 0 additions & 3 deletions packages/ui/cypress/support/page-objects/settings.ts

This file was deleted.

29 changes: 14 additions & 15 deletions packages/ui/cypress/tests/watched-acccounts/watched-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import { landingPage } from '../../support/page-objects/landingPage'
import { settingsPage } from '../../support/page-objects/settingsPage'

describe('Watched Accounts', () => {

it('can add an account to the watch list', () => {
cy.visit(localHost)
landingPage.watchAccountButton().click()
settingsPage.accountAddressInput().type(`${addresses.Alice}{enter}`)
// autocomplete on the input seems to affect reliability so we wait a bit
cy.wait(1000)
settingsPage.accountNameInput().type("{selectall}{del}Alice")
settingsPage.accountNameInput().type('{selectall}{del}Alice')
settingsPage.addButton().click()
settingsPage.accountContainer().within(() => {
settingsPage.accountIcon().should("be.visible")
settingsPage.accountAddressLabel().should("be.visible")
settingsPage.accountNameLabel().should("be.visible")
settingsPage.accountDeleteButton().should("be.visible")
settingsPage.accountIcon().should('be.visible')
settingsPage.accountAddressLabel().should('be.visible')
settingsPage.accountNameLabel().should('be.visible')
settingsPage.accountDeleteButton().should('be.visible')
})
})

Expand All @@ -29,10 +28,10 @@ describe('Watched Accounts', () => {
landingPage.watchAccountButton().click()
settingsPage.accountContainer().within(() => {
settingsPage.accountDeleteButton().click()
settingsPage.accountIcon().should("not.exist")
settingsPage.accountAddressLabel().should("not.exist")
settingsPage.accountIcon().should('not.exist')
settingsPage.accountAddressLabel().should('not.exist')
})
settingsPage.accountContainer().should("have.length", 0)
settingsPage.accountContainer().should('have.length', 0)
})

it('can see error when attemping to add same address more than once', () => {
Expand All @@ -45,19 +44,19 @@ describe('Watched Accounts', () => {
// attempt to add the same account again
settingsPage.accountAddressInput().type(`${addresses.Alice}{enter}`)
cy.wait(1000)
settingsPage.accountNameInput().type("{selectall}{del}Alice")
settingsPage.accountNameInput().type('{selectall}{del}Alice')
settingsPage.addButton().click()
settingsPage.errorLabel().should("be.visible")
settingsPage.accountContainer().should("have.length", 1)
settingsPage.errorLabel().should('be.visible')
settingsPage.accountContainer().should('have.length', 1)
})

it('can see error when attempting to add an invalid address', () => {
cy.visit(localHost)
landingPage.watchAccountButton().click()
settingsPage.accountAddressInput().type("123{enter}")
settingsPage.accountAddressInput().type('123{enter}')
cy.wait(1000)
settingsPage.addButton().click()
settingsPage.errorLabel().should("be.visible")
settingsPage.accountContainer().should("have.length", 0)
settingsPage.errorLabel().should('be.visible')
settingsPage.accountContainer().should('have.length', 0)
})
})

0 comments on commit 065f309

Please sign in to comment.