mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-14 11:56:44 +00:00
* commit initial draft for supplier import * complete import wizard * allow importing only mp and sp * improved sample supplier plugin * add docs * add tests * bump api version * fix schema docu * fix issues from code review * commit unstaged changes * fix test * refactor part parameter bulk creation * try to fix test * fix tests * fix test for mysql * fix test * support multiple suppliers by a single plugin * hide import button if there is no supplier import plugin * make form submitable via enter * add pui test * try to prevent race condition * refactor api calls in pui tests * try to fix tests again? * fix tests * trigger: ci * update changelog * fix api_version * fix style * Update CHANGELOG.md Co-authored-by: Matthias Mair <code@mjmair.com> * add user docs --------- Co-authored-by: Matthias Mair <code@mjmair.com>
49 lines
902 B
TypeScript
49 lines
902 B
TypeScript
import { expect } from 'playwright/test';
|
|
|
|
import { createApi } from './api';
|
|
|
|
/*
|
|
* Set the value of a global setting in the database
|
|
*/
|
|
export const setSettingState = async ({
|
|
setting,
|
|
value,
|
|
type = 'global',
|
|
plugin
|
|
}: {
|
|
setting: string;
|
|
value: any;
|
|
type?: 'global' | 'plugin';
|
|
plugin?: string;
|
|
}) => {
|
|
const api = await createApi();
|
|
const url =
|
|
type === 'global'
|
|
? `settings/global/${setting}/`
|
|
: `plugins/${plugin}/settings/${setting}/`;
|
|
const response = await api.patch(url, {
|
|
data: {
|
|
value: value
|
|
}
|
|
});
|
|
|
|
expect(response.status()).toBe(200);
|
|
};
|
|
|
|
export const setPluginState = async ({
|
|
plugin,
|
|
state
|
|
}: {
|
|
plugin: string;
|
|
state: boolean;
|
|
}) => {
|
|
const api = await createApi();
|
|
const response = await api.patch(`plugins/${plugin}/activate/`, {
|
|
data: {
|
|
active: state
|
|
}
|
|
});
|
|
|
|
expect(response.status()).toBe(200);
|
|
};
|