Skip to content

Commit 94f075e

Browse files
committed
fix spec
1 parent 91f00b1 commit 94f075e

1 file changed

Lines changed: 6 additions & 22 deletions

File tree

app/core/BackgroundBridge/BackgroundBridge.test.js

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ describe('BackgroundBridge', () => {
17631763
const bridge = setupBackgroundBridge(url);
17641764
const notifySpy = jest.spyOn(bridge, 'notifyCaipAuthorizationChange');
17651765

1766-
const mockInitialCaveatValue = {
1766+
const mockCaveatValue = {
17671767
requiredScopes: {},
17681768
optionalScopes: {
17691769
'eip155:1': {
@@ -1773,32 +1773,16 @@ describe('BackgroundBridge', () => {
17731773
isMultichainOrigin: true,
17741774
sessionProperties: {},
17751775
};
1776-
const mockRefetchedCaveatValue = {
1777-
requiredScopes: {},
1778-
optionalScopes: {
1779-
'eip155:1': {
1780-
accounts: ['eip155:1:0xAbCdEf0123456789abcdef0123456789AbCdEf01'],
1781-
},
1782-
},
1783-
isMultichainOrigin: true,
1784-
sessionProperties: {},
1785-
};
17861776
PermissionController.getCaveat.mockClear();
1787-
PermissionController.getCaveat
1788-
.mockReturnValueOnce({
1789-
type: Caip25CaveatType,
1790-
value: mockInitialCaveatValue,
1791-
})
1792-
.mockReturnValueOnce({
1793-
type: Caip25CaveatType,
1794-
value: mockRefetchedCaveatValue,
1795-
});
1777+
PermissionController.getCaveat.mockReturnValueOnce({
1778+
type: Caip25CaveatType,
1779+
value: mockCaveatValue,
1780+
});
17961781

17971782
bridge.handleSessionChangedFromSelectedAccountGroupChanges();
17981783

17991784
expect(PermissionController.getCaveat).toHaveBeenCalledTimes(1);
1800-
expect(notifySpy).toHaveBeenCalledWith(mockRefetchedCaveatValue);
1801-
expect(notifySpy).not.toHaveBeenCalledWith(mockInitialCaveatValue);
1785+
expect(notifySpy).toHaveBeenCalledWith(mockCaveatValue);
18021786
});
18031787

18041788
it('does not call notifyCaipAuthorizationChange if the caveat is revoked before the setTimeout fires', () => {

0 commit comments

Comments
 (0)