Skip to content
Snippets Groups Projects
Commit e9001852 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

reloading plugin should not remove it from list of loaded plugin

parent f31f6273
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!197Resolve "[MIN-282] Plugins: refresh plugin"
Pipeline #90054 passed
......@@ -105,7 +105,11 @@ export const useLoadPlugin = ({
};
const handleReloadPlugin = async (): Promise<void> => {
handleUnloadPlugin();
PluginsManager.removePluginContent({ hash });
PluginsManager.unloadActivePlugin(hash);
PluginsEventBus.dispatchEvent('onPluginUnload', { hash });
await handleLoadPlugin();
};
......
......@@ -80,26 +80,16 @@ describe('PluginHeaderInfo - component', () => {
});
it('reload plugin on reload button', async () => {
const { store } = renderComponent(STATE, PLUGIN);
renderComponent(STATE, PLUGIN);
mockedAxiosClient.onGet(PLUGIN.urls[FIRST_ARRAY_ELEMENT]).reply(HttpStatusCode.Ok, '');
const button = screen.getByRole(RELOAD_PLUGIN_DRAWER_BUTTON_ROLE);
button.click();
const actions = store.getActions();
expect(removePluginContentSpy).toHaveBeenCalledWith({
hash: PLUGIN.hash,
});
expect(actions).toEqual([
{ payload: { pluginId: '5e3fcb59588cc311ef9839feea6382eb' }, type: 'plugins/removePlugin' },
{
payload: '5e3fcb59588cc311ef9839feea6382eb',
type: 'legend/removePluginLegend',
},
]);
await waitFor(() => {
expect(setHashedPluginSpy).toHaveBeenCalledWith({
pluginScript: '',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment