Skip to content

Commit

Permalink
add consstant
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp committed Dec 12, 2024
1 parent 1dcdb1a commit b9c44e8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/scaffold-ui/test/modal/w3m-account-button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const mockCaipNetwork: CaipNetwork = {
nativeCurrency: { name: '', symbol: '', decimals: 0 },
rpcUrls: { default: { http: [], webSocket: undefined } }
}

const mockCaipAddress = 'eip155:1:0x0000000000000000000000000000000000000000'
describe('W3mAccountButton', () => {
afterEach(() => {
vi.clearAllMocks()
Expand Down Expand Up @@ -69,9 +71,7 @@ describe('W3mAccountButton', () => {
it('should open modal normally when chain is supported', async () => {
vi.spyOn(ChainController.state, 'activeChain', 'get').mockReturnValue('eip155')
vi.spyOn(ChainController, 'checkIfSupportedNetwork').mockReturnValue(true)
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(
'eip155:1:0x0000000000000000000000000000000000000000'
)
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(mockCaipAddress)

vi.spyOn(ModalController, 'open')

Expand All @@ -90,9 +90,7 @@ describe('W3mAccountButton', () => {
...OptionsController.state,
allowUnsupportedChain: true
})
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(
'eip155:1:0x0000000000000000000000000000000000000000'
)
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(mockCaipAddress)

vi.spyOn(ModalController, 'open')

Expand All @@ -111,9 +109,7 @@ describe('W3mAccountButton', () => {
...OptionsController.state,
allowUnsupportedChain: false
})
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(
'eip155:1:0x0000000000000000000000000000000000000000'
)
vi.spyOn(ChainController.state, 'activeCaipAddress', 'get').mockReturnValue(mockCaipAddress)

vi.spyOn(ModalController, 'open')

Expand Down

0 comments on commit b9c44e8

Please sign in to comment.