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:
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user