Introduce PluginRenderer to render plugins
Summary: PluginContainer will now wrap Sandy plugins in PluginRenderer. PluginRenderer will also be used by plugin unit tests in the future Reviewed By: jknoxville Differential Revision: D22159359 fbshipit-source-id: 69f9c8f4bec9392022c1d7a14957f5aca0339d97
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba01fa5bc9
commit
f2c39aed55
@@ -7,7 +7,10 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {createMockFlipperWithPlugin} from '../../test-utils/createMockFlipperWithPlugin';
|
||||
import {
|
||||
createMockFlipperWithPlugin,
|
||||
createMockPluginDetails,
|
||||
} from '../../test-utils/createMockFlipperWithPlugin';
|
||||
import {Store, Client} from '../../';
|
||||
import {selectPlugin, starPlugin} from '../../reducers/connections';
|
||||
import {registerPlugins} from '../../reducers/plugins';
|
||||
@@ -21,18 +24,7 @@ interface PersistedState {
|
||||
count: 1;
|
||||
}
|
||||
|
||||
const pluginDetails = {
|
||||
id: 'TestPlugin',
|
||||
dir: '',
|
||||
name: 'TestPlugin',
|
||||
specVersion: 0,
|
||||
entry: '',
|
||||
isDefault: false,
|
||||
main: '',
|
||||
source: '',
|
||||
title: 'Testing Plugin',
|
||||
version: '',
|
||||
} as const;
|
||||
const pluginDetails = createMockPluginDetails();
|
||||
|
||||
let TestPlugin: SandyPluginDefinition;
|
||||
|
||||
@@ -114,11 +106,10 @@ test('it should not initialize a sandy plugin if not enabled', async () => {
|
||||
const {client, store} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
|
||||
const Plugin2 = new SandyPluginDefinition(
|
||||
{
|
||||
...pluginDetails,
|
||||
createMockPluginDetails({
|
||||
name: 'Plugin2',
|
||||
id: 'Plugin2',
|
||||
},
|
||||
}),
|
||||
{
|
||||
plugin: jest.fn().mockImplementation((client) => {
|
||||
const destroyStub = jest.fn();
|
||||
|
||||
Reference in New Issue
Block a user