Command processing (2/n): testing

Summary:
*Stack summary*: this stack refactors plugin management actions to perform them in a dispatcher rather than in the root reducer (store.tsx) as all of these actions has side effects. To do that, we store requested plugin management actions (install/update/uninstall, star/unstar) in a queue which is then handled by pluginManager dispatcher. This dispatcher then dispatches all required state updates.

*Diff summary*: refactored Flipper mocking helpers to allow testing of plugin commands, and wrote some tests for pluginManager.

Reviewed By: mweststrate

Differential Revision: D26450344

fbshipit-source-id: 0e8414517cc1ad353781dffd7ffb4a5f9a815d38
This commit is contained in:
Anton Nikolaev
2021-02-16 10:46:11 -08:00
committed by Facebook GitHub Bot
parent 8efdde08c4
commit 24aed8fd45
8 changed files with 551 additions and 108 deletions

View File

@@ -250,7 +250,9 @@ test('it can send messages from sandy clients', async () => {
});
test('it should initialize "Navigation" plugin if not enabled', async () => {
const {client, store} = await createMockFlipperWithPlugin(TestPlugin);
const {client, store} = await createMockFlipperWithPlugin(TestPlugin, {
supportedPlugins: ['Navigation'],
});
const Plugin2 = new _SandyPluginDefinition(
TestUtils.createMockPluginDetails({