@onekeyfe/hd-transport-web-device 1.2.8-alpha.2 → 1.2.8-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -182,6 +182,20 @@ describe('ElectronBleTransport protocol detection', () => {
182
182
  jest.clearAllMocks();
183
183
  });
184
184
 
185
+ test.each([
186
+ { errorCode: HardwareErrorCode.BleLocationError, message: 'Permission denied' },
187
+ { code: HardwareErrorCode.BleLocationError },
188
+ { message: 'Bluetooth unauthorized' },
189
+ ])('preserves Bluetooth permission failures from the native bridge: %j', async error => {
190
+ const nobleBle = createNobleBle();
191
+ nobleBle.enumerate.mockRejectedValueOnce(error);
192
+ const bleTransport = configureTransport(nobleBle);
193
+
194
+ await expect(bleTransport.enumerate()).rejects.toMatchObject({
195
+ errorCode: HardwareErrorCode.BleLocationError,
196
+ });
197
+ });
198
+
185
199
  test('does not treat an error envelope from a legacy preload as a successful connect', async () => {
186
200
  const device = { id: 'legacy-error-id', name: 'OneKey Pro 2' };
187
201
  const nobleBle = createNobleBle(device);