Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Oct 9, 2023
1 parent ec2a98c commit 996a1f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ import { createPushNotificationPrefsIndexedDb } from '@/services/push-notificati
import { render } from '@/tests/test-utils'
import type { AddedSafesOnChain } from '@/store/addedSafesSlice'
import type { PushNotificationPreferences } from '@/services/push-notifications/preferences'
import * as useWallet from '@/hooks/wallets/useWallet'
import type { EIP1193Provider } from '@web3-onboard/core'

Object.defineProperty(globalThis, 'crypto', {
value: {
randomUUID: () => Math.random().toString(),
},
})

jest.spyOn(useWallet, 'default').mockImplementation(() => ({
ens: '',
address: '0x1230000000000000000000000000000000000000',
provider: jest.fn() as unknown as EIP1193Provider,
label: 'Metamask',
chainId: '4',
}))

describe('PushNotificationsBanner', () => {
describe('getSafesToRegister', () => {
it('should return all added safes if no preferences exist', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import { FEATURES } from '@/utils/chains'
import type { AddedSafesOnChain } from '@/store/addedSafesSlice'
import type { PushNotificationPreferences } from '@/services/push-notifications/preferences'
import type { NotifiableSafes } from '../logic'
import useWallet from '@/hooks/wallets/useWallet'

import css from './styles.module.css'
import useWallet from '@/hooks/wallets/useWallet'

const DISMISS_PUSH_NOTIFICATIONS_KEY = 'dismissPushNotifications'

Expand Down

0 comments on commit 996a1f0

Please sign in to comment.