Skip to content

Commit bf52606

Browse files
committed
Test calls to getSnapState hook
1 parent 3ad1e63 commit bf52606

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/snaps-rpc-methods/src/permitted/setState.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe('snap_setState', () => {
6363
});
6464

6565
expect(getUnlockPromise).toHaveBeenCalled();
66+
expect(getSnapState).toHaveBeenCalledWith(true);
6667
expect(updateSnapState).toHaveBeenCalledWith({ foo: 'baz' }, true);
6768

6869
expect(response).toStrictEqual({
@@ -116,6 +117,7 @@ describe('snap_setState', () => {
116117
});
117118

118119
expect(getUnlockPromise).toHaveBeenCalled();
120+
expect(getSnapState).not.toHaveBeenCalled();
119121
expect(updateSnapState).toHaveBeenCalledWith({ foo: 'baz' }, true);
120122

121123
expect(response).toStrictEqual({
@@ -169,6 +171,7 @@ describe('snap_setState', () => {
169171
});
170172

171173
expect(getUnlockPromise).not.toHaveBeenCalled();
174+
expect(getSnapState).toHaveBeenCalledWith(false);
172175
expect(updateSnapState).toHaveBeenCalledWith(
173176
{
174177
foo: 'baz',

0 commit comments

Comments
 (0)