Skip to content

Commit 147ba9f

Browse files
committed
Revert some test changes (comments)
1 parent 4b6dcde commit 147ba9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/multichain-account-service/src/snaps/SnapPlatformWatcher.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,24 @@ describe('SnapPlatformWatcher', () => {
121121
const { rootMessenger, messenger } = setup();
122122
const watcher = new SnapPlatformWatcher(messenger);
123123

124+
// Make platform ready
124125
publishIsReadyState(rootMessenger, true);
126+
127+
// Should work
125128
expect(await watcher.ensureCanUseSnapPlatform()).toBeUndefined();
126129

130+
// Make platform unavailable.
127131
publishIsReadyState(rootMessenger, false);
132+
133+
// Should fail.
128134
await expect(watcher.ensureCanUseSnapPlatform()).rejects.toThrow(
129135
'Snap platform cannot be used now.',
130136
);
131137

138+
// Make platform ready again.
132139
publishIsReadyState(rootMessenger, true);
140+
141+
// Should work again.
133142
expect(await watcher.ensureCanUseSnapPlatform()).toBeUndefined();
134143
});
135144

@@ -215,6 +224,7 @@ describe('SnapPlatformWatcher', () => {
215224
it('resolves immediately if platform is already ready', async () => {
216225
const { messenger, mocks } = setup();
217226

227+
// Make the platform ready before creating the watcher.
218228
mocks.SnapController.getState.mockReturnValue({
219229
isReady: true,
220230
} as SnapControllerState);

0 commit comments

Comments
 (0)