mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 03:26:45 +00:00
Bug fix for activating plugins via UI (#9338)
This commit is contained in:
parent
3260d94369
commit
ae1ec31ca9
@ -250,7 +250,7 @@ export default function PluginListTable() {
|
||||
pathParams: { key: selectedPluginKey },
|
||||
preFormContent: activateModalContent,
|
||||
fetchInitialData: false,
|
||||
method: 'POST',
|
||||
method: 'PATCH',
|
||||
successMessage: activate
|
||||
? t`The plugin was activated`
|
||||
: t`The plugin was deactivated`,
|
||||
|
@ -1,6 +1,11 @@
|
||||
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 { setPluginState, setSettingState } from './settings.js';
|
||||
|
||||
@ -51,6 +56,29 @@ test('Plugins - Settings', async ({ page, request }) => {
|
||||
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 }) => {
|
||||
await doQuickLogin(page, 'admin', 'inventree');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user