2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-17 23:08:28 +00:00

Barcode scan tweaks (#10992)

* Remove duplicate tooltip

* Adjust default value

* docs update

* Tweak unit test

* Fix playwright tests
This commit is contained in:
Oliver
2025-12-11 16:19:47 +11:00
committed by GitHub
parent 0723c74567
commit 20c7a5b5b8
9 changed files with 49 additions and 13 deletions
+25
View File
@@ -1,4 +1,5 @@
import type { Page } from '@playwright/test';
import { createApi } from '../api';
import { test } from '../baseFixtures';
import { doCachedLogin } from '../login';
@@ -128,9 +129,33 @@ test('Barcode Scanning - Build', async ({ browser }) => {
test('Barcode Scanning - Forms', async ({ browser }) => {
const page = await doCachedLogin(browser, {
username: 'admin',
password: 'inventree',
url: '/stock/location/index/stock-items'
});
// Ensure the user setting is enabled
const api = await createApi({});
let patched = false;
await api
.patch('/api/settings/user/BARCODE_IN_FORM_FIELDS/', {
data: {
value: true
}
})
.then((response) => {
patched = response.status() === 200;
});
// Assert that the setting was patched successfully
if (!patched) {
throw new Error('Could not patch user setting: BARCODE_IN_FORM_FIELDS');
}
await page.reload();
// Open the "Add Stock Item" form
await page
.getByRole('button', { name: 'action-button-add-stock-item' })