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]>
369 lines
15 KiB
JavaScript
369 lines
15 KiB
JavaScript
import * as constants from '../../support/constants'
|
|
import * as main from '../pages/main.page'
|
|
import * as safeNav from '../pages/safe_navigation.pages'
|
|
import * as sideBar from '../pages/sidebar.pages'
|
|
import * as assets from '../pages/assets.pages.js'
|
|
import * as accountsModal from '../pages/accounts_modal.pages.js'
|
|
import * as ls from '../../support/localstorage_data.js'
|
|
import * as create_wallet from '../pages/create_wallet.pages.js'
|
|
import * as dashboard from '../pages/dashboard.pages.js'
|
|
import * as navigation from '../pages/navigation.page.js'
|
|
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
|
|
import * as wallet from '../../support/utils/wallet.js'
|
|
import safes from '../../fixtures/safes/static.js'
|
|
|
|
let staticSafes = []
|
|
|
|
const newSafeName = 'Added safe 3'
|
|
const addedSafe900 = 'Added safe 900'
|
|
|
|
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS'))
|
|
const signer = walletCredentials.OWNER_4_PRIVATE_KEY
|
|
const signer1 = walletCredentials.OWNER_1_PRIVATE_KEY
|
|
const signer2 = walletCredentials.OWNER_3_PRIVATE_KEY
|
|
|
|
describe('Safe selector tests - connect wallet prompt', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify connect wallet button is shown in the dropdown when wallet is not connected and no safes are added', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9, { skipAutoTrust: true })
|
|
safeNav.openSelector()
|
|
safeNav.verifyConnectWalletBtnVisible()
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - details and currency', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify current safe details are shown in the safe selector trigger', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
safeNav.verifySafeIconVisible()
|
|
safeNav.verifySafeSelectorTriggerName(safes.SEP_STATIC_SAFE_9_SHORT)
|
|
safeNav.verifySafeSelectorThreshold(2, 2)
|
|
})
|
|
|
|
it('Verify fiat currency changes when edited in the assets tab are reflected in the safe selector trigger', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
assets.changeCurrency(assets.currencyCAD)
|
|
safeNav.verifyCurrencySection(assets.currency$)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - welcome page redirect', () => {
|
|
it('Verify connected user is redirected from welcome page to accounts page', () => {
|
|
cy.visit(constants.welcomeUrl + '?chain=sep')
|
|
cy.get(create_wallet.welcomeLoginScreen).should('be.visible')
|
|
cy.get(create_wallet.connectWalletBtn).should('be.visible').click()
|
|
wallet.connectSigner(signer)
|
|
cy.location().should((loc) => {
|
|
expect(loc.pathname).to.eq('/welcome/accounts')
|
|
})
|
|
cy.get(create_wallet.accountInfoHeader).should('be.visible')
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - trusted safes in accounts modal', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
beforeEach(() => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1Safe2)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
})
|
|
|
|
it('Verify that trusted safes appear in the accounts modal under Trusted Safes', () => {
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyPinnedAccountsSectionVisible()
|
|
accountsModal.verifyPinnedSafeExists(sideBar.sideBarSafes.safe1short)
|
|
accountsModal.verifyPinnedSafeExists(sideBar.sideBarSafes.safe2short)
|
|
})
|
|
|
|
it('Verify there is an option to rename an unnamed safe in the accounts modal', () => {
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.clickSafeOptionsBtn(0)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - pin/unpin and undeployed safes', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify "Add safe" button is displayed in the accounts modal', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyAddSafeButtonVisible()
|
|
})
|
|
|
|
it('Verify a safe can be removed from the trusted list', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyPinnedAccountsSectionVisible()
|
|
accountsModal.unpinSafeByName(sideBar.sideBarSafes.safe1short)
|
|
accountsModal.verifyPinnedSafeDoesNotExist(sideBar.sideBarSafes.safe1short)
|
|
})
|
|
|
|
it('Verify undeployed safe appears in the trusted list', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set6_undeployed_safe)
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__undeployedSafes, ls.undeployedSafe.safe1)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyPinnedAccountsSectionVisible()
|
|
accountsModal.verifyPinnedSafeExists(sideBar.sideBarSafes.safe4short)
|
|
})
|
|
|
|
it('Verify untrusted safe can be added to trusted list from dashboard action required panel', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9, { skipAutoTrust: true })
|
|
wallet.connectSigner(signer)
|
|
dashboard.verifyActionRequiredCard({ messages: [dashboard.nonPinnedWarningTitle] })
|
|
dashboard.clickActionInPanel(dashboard.trustThisSafeButtonTestId)
|
|
dashboard.verifyTrustDialogVisible()
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - accounts modal search', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify the search input is shown above the pinned safes list', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifySearchInputAbovePinnedSection()
|
|
})
|
|
|
|
it('Verify search finds safes in the trusted list', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1Safe2)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.searchSafe(sideBar.sideBarSafes.safe1short_)
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.safe1short)
|
|
accountsModal.verifyAccountsListItemCount(1)
|
|
})
|
|
|
|
it('Verify searching for a safe name filters out those who do not match', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1Safe2)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.searchSafe(sideBar.sideBarSafes.safe1short_)
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.safe1short)
|
|
accountsModal.verifyAccountsListDoesNotContain(sideBar.sideBarSafes.safe2short)
|
|
})
|
|
|
|
it('Verify searching for a safe also finds safes in different networks', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe3TwoChains)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.searchSafe(sideBar.sideBarSafes.multichain_short_)
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.multichain_short_)
|
|
})
|
|
|
|
it('Verify clearing the search input returns back to the full list', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1Safe2)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.searchSafe(sideBar.sideBarSafes.safe1short_)
|
|
accountsModal.verifyAccountsListDoesNotContain(sideBar.sideBarSafes.safe2short)
|
|
accountsModal.clearSearchInput()
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.safe1short)
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.safe2short)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - accounts modal actions', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify Import button is present on the accounts page', () => {
|
|
cy.visit(constants.welcomeAccountsSepoliaUrl)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.verifyImportBtnVisible()
|
|
})
|
|
|
|
it('Verify safes added to watchlist appear in the accounts modal', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer1)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyAccountsListContains(sideBar.sideBarSafes.safe3short)
|
|
})
|
|
|
|
it('Verify missing signature info is shown for a safe in the accounts modal', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedPendingSafe1)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
|
|
wallet.connectSigner(signer2)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyMissingSignatureInfoExists()
|
|
})
|
|
|
|
it('Verify balance is displayed in the accounts modal safe item', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedPendingSafe1)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.verifyFiatBalanceExists()
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - added safes', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
beforeEach(() => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set2)
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
|
|
})
|
|
|
|
it('Verify added safes are listed in the safe selector dropdown', () => {
|
|
safeNav.openSelector()
|
|
safeNav.verifyAddedSafesInDropdown(sideBar.addedSafesSepolia)
|
|
})
|
|
|
|
it('Verify a safe can be renamed via the accounts modal', () => {
|
|
accountsModal.openAccountsModal()
|
|
accountsModal.renameSafe(addedSafe900, newSafeName)
|
|
accountsModal.verifyAccountsListContains(newSafeName)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - watchlist in dropdown', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify that safes the user does not own appear in the safe selector dropdown after adding them', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer2)
|
|
|
|
safeNav.openSelector()
|
|
|
|
safeNav.verifyDropdownContainsSafe(sideBar.sideBarSafes.safe3short)
|
|
})
|
|
|
|
it('Verify that safes the user owns appear in the safe selector dropdown after adding them', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer1)
|
|
|
|
safeNav.openSelector()
|
|
|
|
safeNav.verifyDropdownContainsSafe(sideBar.sideBarSafes.safe3short)
|
|
})
|
|
|
|
it('Verify that a watched safe with a pending tx appears in the safe selector dropdown', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedPendingSafe1)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
wallet.connectSigner(signer2)
|
|
|
|
safeNav.openSelector()
|
|
|
|
safeNav.verifyDropdownContainsSafe(sideBar.sideBarSafesPendingActions.safe1short)
|
|
})
|
|
|
|
it('Verify the first row in the safe selector dropdown shows a balance', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
|
|
safeNav.openSelector()
|
|
|
|
safeNav.verifyFirstDropdownRowHasBalance()
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - pin toggle in accounts modal', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify that pinning a safe in the accounts modal moves it into the trusted safes section', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9, { skipAutoTrust: true })
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
|
|
accountsModal.verifyPinnedSafeDoesNotExist(safes.SEP_STATIC_SAFE_9_SHORT)
|
|
accountsModal.pinSafeByName(safes.SEP_STATIC_SAFE_9_SHORT)
|
|
|
|
accountsModal.verifyPinnedAccountsSectionVisible()
|
|
accountsModal.verifyPinnedSafeExists(safes.SEP_STATIC_SAFE_9_SHORT)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - new transaction button states', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify the new transaction button is enabled for proposers', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_31)
|
|
wallet.connectSigner(signer1)
|
|
|
|
navigation.verifyTxBtnStatus(constants.enabledStates.enabled)
|
|
})
|
|
|
|
it('Verify the new transaction button is disabled for disconnected users', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
|
|
|
|
navigation.verifyTxBtnStatus(constants.enabledStates.disabled)
|
|
})
|
|
|
|
it('Verify the new transaction button is disabled for connected non-owners', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
|
|
wallet.connectSigner(signer1)
|
|
|
|
navigation.verifyTxBtnStatus(constants.enabledStates.disabled)
|
|
})
|
|
|
|
it('Verify the new transaction button is enabled for non-owners with spending limits', () => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_11)
|
|
wallet.connectSigner(signer)
|
|
|
|
navigation.verifyTxBtnStatus(constants.enabledStates.enabled)
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - add safe button', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify the add safe button in the accounts modal navigates to the load safe flow', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.sidebarTrustedSafe1)
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
|
|
accountsModal.openAccountsModal()
|
|
|
|
accountsModal.clickAddSafeButtonAndVerifyLoadFlow()
|
|
})
|
|
})
|
|
|
|
describe('Safe selector tests - threshold tag visible for owners and non-owners', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
it('Verify the threshold badge is shown on safe cards for both owner and non-owner safes', () => {
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set3)
|
|
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes)
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_11)
|
|
wallet.connectSigner(signer)
|
|
accountsModal.openAccountsModal()
|
|
|
|
accountsModal.verifyThresholdBadgeOnSafeCard('Added owner')
|
|
accountsModal.verifyThresholdBadgeOnSafeCard('Added non-owner')
|
|
})
|
|
})
|