2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Bug fix for activating plugins via UI (#9338)

This commit is contained in:
Oliver 2025-03-20 09:16:31 +11:00 committed by GitHub
parent 3260d94369
commit ae1ec31ca9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 2 deletions

View File

@ -250,7 +250,7 @@ export default function PluginListTable() {
pathParams: { key: selectedPluginKey }, pathParams: { key: selectedPluginKey },
preFormContent: activateModalContent, preFormContent: activateModalContent,
fetchInitialData: false, fetchInitialData: false,
method: 'POST', method: 'PATCH',
successMessage: activate successMessage: activate
? t`The plugin was activated` ? t`The plugin was activated`
: t`The plugin was deactivated`, : t`The plugin was deactivated`,

View File

@ -1,6 +1,11 @@
import test from 'playwright/test'; import test from 'playwright/test';
import { clearTableFilters, loadTab, navigate } from './helpers.js'; import {
clearTableFilters,
clickOnRowMenu,
loadTab,
navigate
} from './helpers.js';
import { doQuickLogin } from './login.js'; import { doQuickLogin } from './login.js';
import { setPluginState, setSettingState } from './settings.js'; import { setPluginState, setSettingState } from './settings.js';
@ -51,6 +56,29 @@ test('Plugins - Settings', async ({ page, request }) => {
await page.getByText('Mouser Electronics').click(); await page.getByText('Mouser Electronics').click();
}); });
// Test base plugin functionality
test('Plugins - Functionality', async ({ page, request }) => {
await doQuickLogin(page, 'admin', 'inventree');
// Navigate and select the plugin
await navigate(page, 'settings/admin/plugin/');
await clearTableFilters(page);
await page.getByPlaceholder('Search').fill('sample');
// Activate the plugin
const cell = await page.getByText('Sample API Caller', { exact: true });
await clickOnRowMenu(cell);
await page.getByRole('menuitem', { name: 'Activate' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('The plugin was activated').waitFor();
// Deactivate the plugin again
await clickOnRowMenu(cell);
await page.getByRole('menuitem', { name: 'Deactivate' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('The plugin was deactivated').waitFor();
});
test('Plugins - Panels', async ({ page, request }) => { test('Plugins - Panels', async ({ page, request }) => {
await doQuickLogin(page, 'admin', 'inventree'); await doQuickLogin(page, 'admin', 'inventree');