mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* fix(web/Spaces): UI adjustments for the Sidebar and stories (#7527) * fix: UI adjustments for the Sidebar and stories * feat: deterministic color for the Space avatar on the Safe level * refactor: replace hardcoded css value with a token * feat(web/Spaces): Sidebar enhancements and polished Stories (#7552) * fix: UI for the Actions Tray CTAs * fix: UI for the Actions Tray CTAs * fix: UI for the Header * feat: add Settings btn to the Safe sidebar * feat: CGW toggle in the Safe sidebar; tooltip when buttons are disabled * feat: add a warning dot to the Settings tab when Safe version is outdated * test: expand test suite for the Safe Sidebar * test: add tests for sidebar when Safe is not deployed * feat: add a story for the sidebar when Safe is not deployed * refactor: replace hardcoded css value with a token * refactor(web/Spaces): remove code duplications; Onboarding pages follow Feature Architecture; tracking fixes (#7575) * refactor: move duplicated code from the sidebar to NavItem component * refactor: Spaces Onboarding components support feature architecture * fix: tracking for Members and Safe accounts (Spaces) per Space instance * test: add tests for the useTrackSpace hook * feat: unify top bar (#7596) * feat: add topbar for safe and space * feat: adjust tests * fix: delete global search bar from space * fix: css fix for mobile * fix: add back the datatest id * fix: fix styling and test id * fix: fix smoke e2e test * fix: add events tracking * fix: fix unit tests * fix: add back original features * fix: fix test * fix: fix regression tests * fix: update tests * fix: delete the place holder * fix: fix sidebar top padding * fix: fix logic * fix: add back placeholder * feat(web): add global search feature (#7618) * feat(web): create initial global search input component * feat(web): add initial seach section draft * feat(web): create the mocked internal layout for the global search * feat(web): integrate accounts page in the AccountsSection * feat(web): add trusted safes list * feat(web): create globalSeach slice * feat(web): add keyboard observable hook to allow global search events * feat(web): allow user to filter global search items by typing on the search input * feat(web): Display no results when there is no items available for the user search * refactor(global-search): streamline global search components and hooks, update imports, and enhance filtering logic * fix(web): topbar conflicts * fix(web): prettier * feat(web): enhance GlobalSearchModal with route change handling and update section items for improved functionality * fix: topbar styling improvement (#7637) * feat(web/Spaces): Sidebar with Add To Space functionality (#7602) * fix: add mock providers for the Safe Sidebar so all NavItems get rendered * fix: UI adjustments for the Spaces Selector Dropdown * feat: Add To Space back btn + Spaces dropdown UI in Stories * feat: new sidebar on the Safe level (WIP) * refactor: move new hooks and components to separate files; move test files to corresponding folders * fix: Storybook fixes for stories with Back To Space btn * refactor: remove unused CSS classes * refactor: separate spaceId extraction fn in utils * feat: notification on success when Safe is added to Space * fix: treat a Safe that is added to a Space as a Qualified Safe * refactor: wrap sidebar functions in useCallback * fix: collapsed API button in the Spaces Sidebar (#7609) * feat: New Transaction btn * test: add tests for the new New Tx Btn * fix: UI fixes for sidebar elements * feat: disable adding to a Space if Safes per Space limit is exceeded * refactor: minior refactoring of Space limit logic * test: add tests for the Space limit functionality * fix: typing * feat: no Add To Space btn for cf safes + tests * feat: stories for different Safe Sidebar states * feat: add tracking events to the new sidebar + tests * feat: add Add Spaces popup modal component + story * refactor: extract the workspace header logic to a new component; add Add To Space modal to the UI * feat: add Shadcn Dialog and wrap App To Space popup into it * fix: UI fixes for the Add To Space modal * fix: add hydration check to the Safe sidebar * test: improve test coverage for new components * refactor: adjust z-indexes * fix: granular error notifications; minor UI fixes * refactor: move the Add To Space modal into a separate spaces component * refactor: rectructure Sidebar components * refactor: simplify Space selector dropdown for better readability * test: increase test coverage * fix: add guard to preventback to space navigation if spaceId is falsy; refactor: minor refactoring * fix: skip failing smoke tests (will be adjusted in another PR) * refactor: simplify components complexity; address issues; skip failing tests * fix: UI: sidebar icons styles match header icons styles * feat: wrap sidebar icons in a tooltip * refactor: prevent a re-render of nav items when tx data arrives later * test: fix failing tests * fix: remove duplicated closing but from Add To Space modal * fix: show API errors in the toaster on safe addition * chore: remove unused css classes * refactor: remove redundant spaceName prop, derive from selectedSpace.name directly * refactor: rename `NewTransactionButton` to `SidebarActionButton` as it handles not only new txs * feat: highlight active item icon in the sidebar * test: add more tests for the safe sidebar * feat(web): add dashboard empty states with SetupWidget and improved accounts widget (#7638) * feat(web): adjust accounts widget empty state component to follow new figma design * feat(web): create static setup widget component * feat(web): enhance SetupWidget with loading state and step sorting logic * feat(web): enhance AddAccounts and SetupWidget components with external state handling and animations * feat(web): enhance SetupWidget with dismissal logic and explore modal integration * feat(web): implement local storage handling for SetupWidget dismissal in SpaceDashboard * refactor(web): clean up SetupWidget test mocks and remove unused Card import in Dashboard * fix(web): unit tests * feat(web): add completion tracking for SetupWidget and update modal close handling * feat(global-search): implement navigate-to actions (#7640) * feat(web/Spaces): UI improvements for the sidebar (#7643) * fix: cut Postgres details from the Add Account error message * feat: add animation to the sidebar * feat: adjust Sidebar skeleton * feat: add animation to the sidebar top to enable smooth transition on toggle * fix: adjust paddings in the top sidebar * fix: adjust the tooltip text when Safes limit is reached * feat: replace sidebar skeleton component with the per-row skeletons to enable faster load of static sidebar items * refactor: performance optimization for animation consts * fix: Spaces avatar position on minimized sidebar * refactor: adjust css classes for a smoother transition with less repaints * test: fix unit tests * fix(web/Spaces): UI fixes for the Sidebar after Design QA (#7657) * refactor: move Settings to the main sidebar menu * fix: active sidebar item styles * fix: static company logo for all sidebar states * fix: minor UI fixes * fix: active item UI in the sidebar when any page tab is opened (#7662) * feat: regenerate CGW schema with address book timestamps (#7666) * feat: redesign Spaces Address Book page with shadcn - Rewrite address book page with shadcn Tabs, Table, Button, Input - Two tabs: Workspace contacts and My contacts (space + local) - Activity log tab showing contact additions/updates timeline - Client-side pagination (25 per page) with fixed column widths - Local contacts shown with address book icon in My contacts tab - Import/Add contact buttons migrated to shadcn (modals remain MUI) - Search bar filters per active tab, resets on tab switch Depends on: safe-global/safe-client-gateway#3024 * feat: regenerate CGW schema with address book timestamps and member type renames - Fetch updated OpenAPI schema from staging CGW that includes createdAt/updatedAt fields on SpaceAddressBookItemDto - Fix createdAt/updatedAt swagger types from object to date-time string - Update all Member → MemberDto and MemberDto → SpaceMemberDto type renames from the CGW schema changes - Remove manual createdAt/updatedAt extension from AddressBookEntry type - Add spaceId skip guard to useGetSpaceAddressBook hook - Update all test mocks to include the new required fields --------- * feat(web): add actions tray feature with redesigned action buttons (#7650) * feat(web): redesign actions tray component * feat(web): add noAssets prop to DashboardHeader for handling asset states * fix(web): add redux mock on dashboard header component * feat(web/Spaces): pass Safe address to the onboarding flow when creating a new Space (#7659) * feat: pass ?safe= query param through onboarding to preselect safe * test: add tests * fix: preserve safe query param also when not SIWE authenticated * fix: UI when not SIWE authenticated after starting Space creation * fix: Story for the Add To Space modal * fix: Safe preselection wirt the correct id * test: add extra tests * fix: adjust the guard so the query param gets passed tot he onboarding when no Spaces * fix: preselection for a multichain safe * refactor: replace hardcoded logic with useSafeQueryParam hook * docs: add JSDoc to the helper function * test: adjust tests * refactor: fix conditionals * feat: disable Add To Space btn when max N of spaces * feat: validate safe address before preselection * refactor: simplify complex pre-selection logic with explicit state * refactor: replace hardcoded multichain safe prefix with a const * feat: hide Add To Space when user is not signed in * fix: adjust UI for sidebar navitems on the Space level * fix: remove unused conditional for the url in Add To Space modal * fix: typing and linting * feat: safe drop down selector (#7652) * feat: add trusted safe to safe selector dropdown * feat: add header and footer for trusted safes * feat: add accounts modal and its logic * fix: fix unwanted eslint * fix: fix tests * feat: optimize space safe bar accounts modal * fix: fix edege case when safe is not in local storage * feat: add trusted safe button * feat: add loading and error component * feat: add address copy button for selector dropdown * feat: add loading skeleton for selector drop down * fix: styling fix when chrome extension is opened * fix: fix the hover * feat: add analytics * fix: add tests * fix: fix type * feat: delete old all accounts modal and create the new one * fix: fix rename z-index issue * feat: show ens name as fallback * feat: show ens name for global search window * feat: update the color of the icon * fix: unify the background color * fix: show connect wallet when no pinned safe and wallect not connected * feat: pin and unpin all networks * feat: trusted safes and other safes * feat: add similarity address check * feat: add navigation * fix: close dropdown when opening all acounts * fix: fix transaction flow cut topbar * fix: add the error handling logic for accounst modal * feat: show toast when fetching users failing * chore: move hook tests the sub folder * fix: change safe logic for better readability * fix: fix nested safe window position * chore: update autogenerated types * feat(web): add SelectSafeModal for space-level actions (#7669) * feat(web): create selectSafeModal component * feat(web): enhance NavigateToSection with space route handling and update SelectSafeModal styles * feat(web): allow user to search by chain prefix * fix(web): remove unnecessary hook * fix(web): cover useSafeActionMapper with unit tests * fix: update schema hash * fix: fix imports after SDK version update * feat(web/Spaces): disable actions for geoblocked users, no-assets, and unsupported chains (#7684) * feat(web): disable safe accounts where swap feature is disabled * feat(web): block the actions button if user is on a not allowed location * fix: unit tests button tooltip * fix(web): typo * feat(web): create storybooks for actions tray component * fix(web/Spaces): No flickering in the Safe Selector Dropdown (#7699) * fix: avoid call duplication on Safe change in Safe Selector Dropdown; add tests * docs: adjust comments * chore: linting * feat: hide SafeBar for account creation and adding (#7691) * fix(web): block clicks on dimmed Receive and Build transaction buttons in empty Spaces (#7706) * fix(web): set min 320px width for global search input, shrink on mobile (#7710) * fix: Update Required warning in Settings UI on the icon instead of NavItem corner (#7716) * feat(web): update corner radius for Spaces and Safe M2 (WA-2003) (#7709) * feat(web): update corner radius for Spaces and Safe M2 (WA-2003) - shadcn Button: 8px → 12px (rounded-sm → rounded-md) - SafeWidget root: 8px → 24px (rounded-sm → rounded-xl) - Spaces Dashboard Paper cards: 12px → 24px - MUI theme: MuiCard + MuiPaper root → 24px, with scoped overrides keeping Dialog/Popover/Menu/Autocomplete/Alert at 6px so dropdowns and modals don't over-round. * tests(web): update MUI snapshots for border-radius theme change Emotion class hashes regenerated after MuiCard/MuiPaper/MuiAlert styleOverrides were updated in the theme package. --------- * fix: regression with Tx History -> Queue redirect (#7718) * feat: create feedback popup (#7683) * feat: create feedback popup * fix: add comment * fix: fix comment * fix(web): snapshots (#7732) * fix(web): Adjust accounts page alignement (#7733) * fix(web): switch SafeCardReadOnly grid activation to 786px Below 786px the card now stays as a flex row instead of collapsing into a broken grid. Inner threshold and pending-tx cells also gate on min-[786px] so they don't leak out as loose flex items between 640–785px. Also drops a dead sm:grid-cols rule that was immediately overridden. * fix(web): use right colors on the defualt button variant * feat(web): move styles to css modules in accounts page --------- * Revert "fix(web): Adjust accounts page alignement (#7733)" (#7741) This reverts commit 52cadbec588bbd51beb6a13c12e3c1c5f4eb8331. * feat(web): expand multi-chain safes into per-chain accordion (#7739) * feat(web): expand multi-chain safes into per-chain accordion (EPD-473) - All Accounts modal: turn `MultiSafeItemCard` into a `Collapsible` that mirrors `PinnedMultiSafeItem`; clicking a multi-chain row now reveals per-chain sub-items with balance, status badges, and pending count. - `PinnedSafeSubItem`: show an "N pending" badge alongside the per-chain balance (used by the modal and pinned multi-safe accordions). - Safe selector dropdown: new `MultiChainSafeItemRow` with the same expand-on-click pattern. Sub-items are `SelectItem`s so picking a chain reuses the existing navigation flow. Pending count, Read-only and Not-activated/Activating badges are surfaced per chain. - Enrich `SafeItemDataChain` + `useSpaceSafeSelectorItems` with per-chain `queued`, `isReadOnly`, `isUndeployed`, `isActivating` from existing overview + undeployed-safes state (no extra HTTP calls). - Remove dead `getMultiChainNavigationSafe` helper — no longer needed now that navigation happens via sub-item selection. * fix(web): wire elementRef in PinnedSafeSubItem so overview loads `useSafeItemData` gates `useGetSafeOverviewQuery` on `useOnceVisible(elementRef)`, so consumers must attach the returned ref to a DOM node. The sub-item ignored it, which kept the query permanently skipped — `fiatTotal` and `queued` never resolved, so the per-chain balance and pending badge silently stayed hidden. Wrap the Link in a ref'd div (same pattern as PinnedSafeItem) and tighten the accordion padding so the sub-rows align with the header. --------- * fix(web): border radius on transactions modal (#7746) * fix(web): Adjust safe apps drawer padding top (#7751) * fix: tooltip only on hover (#7752) * chore: regenerate CGW schema and types (#7738) Pick up latest CGW schema changes: drop unused contractAddresses from Chain, add safeTxHash to relay endpoint, add createdAt/updatedAt to SpaceAddressBookItemDto. Update test mocks to match the new shapes. Also fix the check-sync script under Node 22: swap the ESM import.meta.url pathname for __dirname and pin ts-node to CommonJS so the auto-generated sync test stops failing with ERR_UNKNOWN_FILE_EXTENSION. * chore: linting * fix(web/Spaces): keep SafeSelector visible for space-level tx flows (#7743) * fix(web/Spaces): keep SafeSelector visible for space-level tx flows Swap in the SpaceSafeBar (with the Space's safes) instead of the global search input when a tx modal is open on a space route, and open TokenTransferFlow directly from the Actions Tray "Send" action. * fix(web/Spaces): clear active Safe context when closing a space-level modal The Send/Receive flows set ?safe= on the space route so the topbar can show the selected Safe. On close that param is now cleared so the user returns to a "no Safe selected" state on the Space page. * fix(web): remove unnecessary information from the transaction modal * fix(web): send user straight to the send tokens modal --------- * fix(web): double border problem on notifications popup problem (#7748) * fix(web): truncate long address book names and clear FAB from pagination (#7744) - Name cell now truncates with ellipsis inside an overflow-hidden flex row (with min-w-0 on the text span so flex actually shrinks it below its intrinsic width) and shows the full name in a Tooltip on hover. - Pagination row gets pr-16 so the chevron buttons sit clear of the help FAB's 72px bottom-right footprint on narrow viewports. * fix: fix batch tx popup is cut by transaction modal (#7750) * fix: fix bactch tx popup * fix: eslint * feat(web/Spaces): Indexing status in the sidebar + loading skeleton (#7757) * feat: add Synced status to the sidebar * feat: API popup is closed by default; fix: footer paddings * refactor: tooltip copy * feat: add SidebarSkeleton * chore: linting * fix: SidebarBurger visible on mid-size screens * fix(web): elevate topbar while tx and recovery modals are open (#7753) * fix(web): make the topbar fixed once the transaction modals/recover is opened * fix(web): elevate topbar while tx and recovery modals are open Wires the useTopbarElevation store into PageLayout and the two modal providers so the topbar sits above the modal backdrop with a fixed position while either flow is active. * tests(web): cover useTopbarElevation store Verifies the external store toggles correctly per modal id, resets on close and unmount, and stays elevated while any modal is still open. --------- * fix: fix topbar and wrapper position in tx builder (#7763) * feat(web/Spaces): no Help Center popup (#7768) * feat: remove unneeded Help Center popup * fix: Feedback Popup position and border * chore: remove unneeded test file * feat: make all accounts button sticky and add scrolling chevron (#7766) * feat: make all accounts button sticky and add scrolling chevron * fix: dibale overscroll and hide the checkmark * fix: fix the chevron icon showing logic * fix: fix failed tests * feat: optimize chain selector (#7734) * feat: optimize chain selector * feat: add not available tag * fix: fix claude comments * fix(web): align safe apps header and SDK widget with new topbar (#7774) * feat(web/Spaces): Beamer and Contact Support in the Sidebar (#7775) * feat: add Contact Suppoert with Pylon * feat: add beamer to the sidebar * fix(web/Spaces): adjust all e2e tests for the new UI (#7688) * fix: import-export smoke tests * fix: add smoke tests for the Safe Selector instead of deprecated Sidebar Accounts * refactor: rename safe_selector to safe_navigation, update imports * refactor: migrate sidebar data-testids to new SafeSelectorDropdown, AccountsModal and Sidebar components; update safe_navigation page object * feat: adjust Address Book regression test * feat: adjust Import Data regression test * feat: adjust Multichain Network regression test * feat: adjust Multichain NetworkSwitch regression test * feat: adjust Nested Safes Curation regression test * fix: change the entry point to Nested Safes everywhere in tests * refactor: move navigation fns to separate files for better separation of concerns; update imports * chore: skip tests that will be adjusted later when UI is ready * feat: initial sidebar tests and safe selector tests; mark old sidebar tests `.skip` * feat: Safe Selector (ex-Sidebar) tests for currency and adding a safe * feat: Safe Selector (ex-Sidebar) tests for Trusted Safes and Connect Wallet * feat: Safe Selector (ex-Sidebar) tests for adding Trusted Safes * feat: new Safe Selector (ex-Sidebar) tests for the Searchbar in Accouts Modal * feat: new Safe Selector (ex-Sidebar) tests for Import in Accouts Modal + welcome page * chore: regenerate CGW schema and types (#7738) Pick up latest CGW schema changes: drop unused contractAddresses from Chain, add safeTxHash to relay endpoint, add createdAt/updatedAt to SpaceAddressBookItemDto. Update test mocks to match the new shapes. Also fix the check-sync script under Node 22: swap the ESM import.meta.url pathname for __dirname and pin ts-node to CommonJS so the auto-generated sync test stops failing with ERR_UNKNOWN_FILE_EXTENSION. * chore: linting * feat: tests for safes watchlist in dropdown * feat: rewrite `sidebar_8` tests for the new ui * feat: rewrite `sidebar_9` tests for the new ui * feat: adjust tests from `sidebar_nonowners` * feat: adjust tests for Multichain Setup * feat: adjust tests for Multichain Safe Selector (ex-Sidebar) * fix: Safe Selector regression tests * fix: navigation for multichain safes * fix: multichain network switch * fix: Load Safe pages nav with new elements * fix: multichain safe selector navigation * fix: Spaces Basic Flow: create space, rename space, delete space -> flow fixes * fix: Spaces Basic Flow: member invitation * fix: Spaces Dashboard test assertions * fix: multiple assertion fixes across Spaces flows --------- Co-authored-by: katspaugh <[email protected]> * fix(web): show pending transactions for all multichain accounts on accounts page (#7769) * fix(web/Spaces): design fixes for accounts widget, batch sidebar and global search (#7767) * fix(BatchSidebar): remove top margin from aside component * fix(web): remove accounts widget chevron * fix(web): adjust global search hover * fix(web): remove global search right space on accounts and trusted safes section * fix: fix top bar ui and disable ens name as fallback (#7776) * fix: fix topbar styling and disable ens name as fallback * fix: add test * fix: linting * fix(web): adjust corner and remove unnecessary information from the recovery modal (#7777) * fix(web): drive topbar safe selector from URL not Redux (#7779) * fix(web): drive topbar safe selector from URL not Redux * fix: add redux address as fallback * feat(web): disable space chain selector during tx flow (#7781) * feat(web): disable space chain selector during tx flow Disables the SpaceChainSelector with cursor-not-allowed and reduced opacity while a transaction flow modal is open, and shows a tooltip explaining that switching networks is not allowed in this screen. * tests(web): cover disabled state of SpaceChainSelector during tx flow --------- * fix: smoke tests (#7783) * feat(web/Spaces): new tracking events (#7782) * feat: add auth tracking events * feat: tracking for space creation start * feat: tracking events for Space creation * feat: membership-related tracking events * feat: add safe / remove safe tracking events * feat: space dashboard view and switch space events * feat: add events for Safe Selection * feat: add events for Actions Tray, Add Contact, Decline Invite * feat: add missing tracking events from old components * chore: typing, linting * feat: add super properties: workspace_id and auth * feat: add Onboarding Wizard events * fix: styles * test: adjust failing tests * fix(web/Spaces): UI fixes: Receive Assets, How To Build On Safe, Safe Selector Dropdown (#7784) * feat: remove obsolete Apps CTA from the UI; fix: no nested buttons * fix: hydration in Safe Selector Dropdown * fix: align safe selector skeletons * fix: keep safe selector skeleton visible during unresolved hydration state * feat: display >3 chains in the Safe Selector; chore: move tests to a separate folder * fix: 0 top border radii in the Spending Limits modal * fix: tooltip for the Tx Builder --------- Co-authored-by: Clóvis Neto <[email protected]> Co-authored-by: Tong Yao <[email protected]> Co-authored-by: katspaugh <[email protected]> Co-authored-by: katspaugh <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
265 lines
8.0 KiB
JavaScript
265 lines
8.0 KiB
JavaScript
import * as constants from '../../support/constants'
|
|
import * as sidebar from '../pages/sidebar.pages'
|
|
import * as main from '../pages/main.page'
|
|
import { addressBookRecipient } from '../pages/address_book.page'
|
|
|
|
const addExistingAccountBtnStr = 'Add existing one'
|
|
const contactStr = 'Choose address, network and a name'
|
|
export const invalidAddressFormatErrorMsg = 'Invalid address format'
|
|
const invalidAddressNameLengthErrorMsg = 'Maximum 50 symbols'
|
|
|
|
const safeDataForm = '[data-testid=load-safe-form]'
|
|
const removeOwnerBtn = '[data-testid="remove-owner-btn"]'
|
|
const addOwnerBtn = '[data-testid="add-new-signer"]'
|
|
const ownerPolicyStepForm = '[data-testid="owner-policy-step-form"]'
|
|
const addressItem = '[data-testid="address-item"]'
|
|
const sideBarIcon = '[data-testid="ChevronRightIcon"]'
|
|
const sidebarCheckIcon = '[data-testid="CheckIcon"]'
|
|
const addressStepNextBtn = '[data-testid="load-safe-next-btn"]'
|
|
const ownerName = '[data-testid="owner-name"]'
|
|
const addressSection = '[data-testid="address-section"]'
|
|
const addBtnStr = 'Add'
|
|
const settingsBtnStr = 'Settings'
|
|
const ownersConfirmationsStr = 'Owners and confirmations'
|
|
const transactionStr = 'Transactions'
|
|
const qrErrorMsg = 'The QR could not be read'
|
|
const safeAddressError = 'Address given is not a valid Safe Account address'
|
|
const ownerNameLabel = 'Signer name'
|
|
export const addSafeStr = 'Add existing Safe Account'
|
|
|
|
const mandatoryNetworks = [constants.networks.sepolia, constants.networks.polygon, constants.networks.ethereum]
|
|
|
|
export function verifyAddresFormatIsValid() {
|
|
cy.get(addressSection).find('label').contains(constants.addressBookErrrMsg.invalidFormat).should('not.exist')
|
|
}
|
|
|
|
export function clickOnAddNewOwnerBtn() {
|
|
cy.get(addOwnerBtn).click()
|
|
}
|
|
|
|
export function verifyOnwerName(index, name) {
|
|
cy.get(ownerName).eq(index).find('input').should('have.value', name)
|
|
cy.get(addressBookRecipient).eq(index).should('contain', name)
|
|
}
|
|
|
|
export function pasteAddress(index, address) {
|
|
cy.get(addressItem)
|
|
.eq(index)
|
|
.find('input')
|
|
.invoke('val', address)
|
|
.wait(1000)
|
|
.trigger('input')
|
|
.wait(1000)
|
|
.trigger('change')
|
|
}
|
|
|
|
export function verifyNumberOfOwners(owners) {
|
|
cy.get(addressItem).should('have.length', owners)
|
|
cy.get(ownerName).should('have.length', owners)
|
|
}
|
|
|
|
export function verifyOwnerAddress(index, address) {
|
|
cy.get(addressItem).eq(index).find('input').should('have.value', address)
|
|
}
|
|
|
|
export function clickOnRemoveOwnerBtn(index) {
|
|
cy.get(removeOwnerBtn).eq(index).click()
|
|
}
|
|
|
|
export function verifyownerNameFormatIsValid() {
|
|
cy.get(ownerName).find('label').contains(ownerNameLabel).should('be.visible')
|
|
}
|
|
|
|
export function clickOnBackBtn() {
|
|
cy.get('button').contains('Back').click()
|
|
}
|
|
export function verifyAddressCheckSum(address) {
|
|
inputAddress(main.formatAddressInCaps(address))
|
|
}
|
|
export function verifyOwnerNames(names) {
|
|
main.verifyValuesExist(safeDataForm, names)
|
|
}
|
|
|
|
export function verifyOwnerNamesInConfirmationStep(names) {
|
|
main.verifyValuesExist(ownerPolicyStepForm, names)
|
|
}
|
|
|
|
export function verifyDataDoesNotExist(data) {
|
|
main.verifyValuesDoNotExist(ownerPolicyStepForm, data)
|
|
}
|
|
|
|
export function inputOwnerName(index, name) {
|
|
cy.get(ownerName)
|
|
.eq(index)
|
|
.find('input')
|
|
.clear()
|
|
.type(name)
|
|
.then(($input) => {
|
|
const typedValue = $input.val()
|
|
expect(name).to.contain(typedValue)
|
|
})
|
|
}
|
|
|
|
export function clearOwnerAddress(index) {
|
|
cy.get(addressItem).eq(index).find('input').clear()
|
|
}
|
|
|
|
export function inputOwnerAddress(index, name) {
|
|
cy.wait(500)
|
|
cy.get(addressItem)
|
|
.eq(index)
|
|
.find('input')
|
|
.clear()
|
|
.type(name)
|
|
.then(($input) => {
|
|
const typedValue = $input.val()
|
|
expect(name).to.contain(typedValue)
|
|
})
|
|
}
|
|
|
|
export function verifyOnwerNameENS(index, ens) {
|
|
cy.get(ownerName).eq(index).find('input').invoke('attr', 'placeholder').should('contain', ens)
|
|
}
|
|
|
|
export function verifyAddressError() {
|
|
cy.get(addressSection).find('label').contains(safeAddressError)
|
|
}
|
|
|
|
export function verifyOnwerInputIsNotEmpty(index) {
|
|
cy.get(ownerName).find('input').eq(index).invoke('attr', 'placeholder').should('not.be.empty')
|
|
}
|
|
|
|
export function checkMainNetworkSelected(network) {
|
|
cy.get(sidebar.chainLogo).eq(0).contains(network).should('be.visible')
|
|
}
|
|
|
|
export function verifyMandatoryNetworksExist() {
|
|
main.verifyValuesExist('ul li', mandatoryNetworks)
|
|
}
|
|
|
|
export function verifyQRCodeErrorMsg() {
|
|
cy.contains(qrErrorMsg).should('be.visible')
|
|
}
|
|
|
|
export function openLoadSafeForm() {
|
|
cy.contains('a', addExistingAccountBtnStr).click()
|
|
cy.contains(contactStr)
|
|
}
|
|
|
|
export function clickNetworkSelector(networkName) {
|
|
cy.get(safeDataForm).contains(networkName).click()
|
|
}
|
|
|
|
export function selectGoerli() {
|
|
cy.get('ul li').contains(constants.networks.goerli).click()
|
|
cy.contains('span', constants.networks.goerli)
|
|
}
|
|
|
|
export function selectSepolia() {
|
|
cy.get('ul li').contains(constants.networks.sepolia).click()
|
|
cy.contains('span', constants.networks.sepolia)
|
|
}
|
|
|
|
export function selectEth() {
|
|
cy.get('ul li').contains(constants.networks.ethereum).click()
|
|
cy.contains('span', constants.networks.ethereum)
|
|
}
|
|
|
|
export function selectPolygon() {
|
|
cy.get('ul li').contains(constants.networks.polygon).click()
|
|
cy.contains('span', constants.networks.polygon)
|
|
}
|
|
|
|
export function inputNameAndAddress(name, address) {
|
|
inputName(name)
|
|
inputAddress(address)
|
|
}
|
|
|
|
export function inputName(name) {
|
|
cy.get(main.nameInput).type(name).should('have.value', name)
|
|
}
|
|
|
|
export function verifyIncorrectAddressErrorMessage() {
|
|
inputAddress('Random text')
|
|
cy.get(main.addressInput).parent().prev('label').contains(invalidAddressFormatErrorMsg)
|
|
}
|
|
|
|
export function verifyNameLengthErrorMessage() {
|
|
cy.get(main.nameInput).parent().prev('label').contains(invalidAddressNameLengthErrorMsg)
|
|
}
|
|
|
|
export function inputAddress(address) {
|
|
cy.get(main.addressInput).should('be.visible').clear().should('exist').type(address, { delay: 50 })
|
|
}
|
|
|
|
export function verifyAddressInputValue(safeAddress) {
|
|
// The address field should be filled with the "bare" QR code's address
|
|
const [, address] = safeAddress.split(':')
|
|
cy.get(main.addressInput).should('have.value', address)
|
|
}
|
|
|
|
export function clickOnNextBtn() {
|
|
cy.contains(main.nextBtnStr).click()
|
|
}
|
|
|
|
export function verifyDataInReviewSection(safeName, ownerName, threshold = null, network = null, ownerAddress = null) {
|
|
cy.findByText(safeName).should('be.visible')
|
|
cy.findByText(ownerName).should('be.visible')
|
|
if (ownerAddress !== null) cy.get(safeDataForm).contains(ownerAddress).should('be.visible')
|
|
if (threshold !== null) cy.get(safeDataForm).contains(threshold).should('be.visible')
|
|
if (network !== null) cy.get(sidebar.chainLogo).eq(0).contains(network).should('be.visible')
|
|
}
|
|
|
|
export function clickOnAddBtn() {
|
|
cy.contains('button', addBtnStr).click()
|
|
}
|
|
|
|
export function veriySidebarSafeNameIsVisible(safeName) {
|
|
cy.get('[data-testid="safe-selector-trigger-name"]').should('contain.text', safeName)
|
|
}
|
|
|
|
export function verifyOwnerNamePresentInSettings(ownername) {
|
|
clickOnSettingsBtn()
|
|
cy.contains(ownername).should('exist')
|
|
}
|
|
|
|
function clickOnSettingsBtn() {
|
|
cy.get('aside ul').contains(settingsBtnStr).click()
|
|
}
|
|
|
|
export function verifyOwnersModalIsVisible() {
|
|
cy.contains(ownersConfirmationsStr).should('be.visible')
|
|
}
|
|
|
|
export function openSidebar() {
|
|
cy.get('aside').within(() => {
|
|
cy.get(sideBarIcon).click({ force: true })
|
|
})
|
|
}
|
|
|
|
export function verifyAddressInsidebar(address) {
|
|
cy.get('li').within(() => {
|
|
cy.contains(address).should('exist')
|
|
})
|
|
}
|
|
|
|
export function verifySidebarIconNumber(number) {
|
|
cy.get(sidebarCheckIcon).next().contains(number).should('exist')
|
|
}
|
|
|
|
export function clickOnPendingActions() {
|
|
cy.get(sidebarCheckIcon).next().click()
|
|
}
|
|
|
|
export function verifyTransactionSectionIsVisible() {
|
|
cy.contains('h3', transactionStr).should('be.visible')
|
|
}
|
|
|
|
export function verifyNumberOfTransactions(startNumber, endNumber) {
|
|
cy.get(`span:contains("${startNumber} out of ${endNumber}")`).should('have.length', 1)
|
|
}
|
|
|
|
export function verifyNextButtonStatus(param) {
|
|
cy.get(addressStepNextBtn).should(param)
|
|
}
|