mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-14 02:07:13 +00:00
Supplier Mixin (#9761)
* 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>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { createApi } from './api';
|
||||
|
||||
/**
|
||||
* Open the filter drawer for the currently visible table
|
||||
* @param page - The page object
|
||||
@@ -130,3 +133,20 @@ export const globalSearch = async (page, query) => {
|
||||
await page.getByPlaceholder('Enter search text').fill(query);
|
||||
await page.waitForTimeout(300);
|
||||
};
|
||||
|
||||
export const deletePart = async (name: string) => {
|
||||
const api = await createApi();
|
||||
const parts = await api
|
||||
.get('part/', {
|
||||
params: { search: name }
|
||||
})
|
||||
.then((res) => res.json());
|
||||
const existingPart = parts.find((p: any) => p.name === name);
|
||||
if (existingPart) {
|
||||
await api.patch(`part/${existingPart.pk}/`, {
|
||||
data: { active: false }
|
||||
});
|
||||
const res = await api.delete(`part/${existingPart.pk}/`);
|
||||
expect(res.status()).toBe(204);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user