Fix bug causing archived devices trying to connect
Reviewed By: nikoant Differential Revision: D28064540 fbshipit-source-id: 43f05c4348a33e9633751bb9f69cd8d17ddd13c4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8a3ba8615d
commit
699343a9ca
@@ -62,6 +62,7 @@ type MockOptions = Partial<{
|
||||
asBackgroundPlugin?: true;
|
||||
supportedPlugins?: string[];
|
||||
device?: BaseDevice;
|
||||
archivedDevice?: boolean;
|
||||
}>;
|
||||
|
||||
function isPluginEnabled(
|
||||
@@ -90,7 +91,8 @@ export async function createMockFlipperWithPlugin(
|
||||
const logger = mockFlipper.logger;
|
||||
const store = mockFlipper.store;
|
||||
|
||||
const createDevice = (serial: string) => mockFlipper.createDevice({serial});
|
||||
const createDevice = (serial: string, archived?: boolean) =>
|
||||
mockFlipper.createDevice({serial, archived});
|
||||
const createClient = async (
|
||||
device: BaseDevice,
|
||||
name: string,
|
||||
@@ -131,7 +133,7 @@ export async function createMockFlipperWithPlugin(
|
||||
|
||||
const device = options?.device
|
||||
? mockFlipper.loadDevice(options?.device)
|
||||
: createDevice('serial');
|
||||
: createDevice('serial', options?.archivedDevice);
|
||||
const client = await createClient(device, 'TestApp');
|
||||
|
||||
store.dispatch(selectDevice(device));
|
||||
|
||||
Reference in New Issue
Block a user