2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 06:31:27 +00:00

[UI] Search shortcut (#10181)

* Add search shortcut

- Use '/' to open search drawer

* Add user setting for spotlight

* Hide spotlight if disabled

* Updated playwright tests
This commit is contained in:
Oliver
2025-08-15 20:41:03 +10:00
committed by GitHub
parent 4cadc433bb
commit 0f04c31ffb
6 changed files with 52 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ import { doCachedLogin } from './login.js';
/**
* Test for integration of django admin button
*/
test('Admin Button', async ({ browser }) => {
test('General - Admin Button', async ({ browser }) => {
const page = await doCachedLogin(browser, {
username: 'admin',
password: 'inventree',
@@ -21,12 +21,17 @@ test('Admin Button', async ({ browser }) => {
});
// Tests for the global search functionality
test('Search', async ({ browser }) => {
test('General - Search', async ({ browser }) => {
const page = await doCachedLogin(browser, {
username: 'steven',
password: 'wizardstaff'
});
// Open the search drawer with a shortcut
await page.keyboard.press('Control+/');
await page.getByRole('textbox', { name: 'global-search-input' }).waitFor();
await page.keyboard.press('Escape');
await globalSearch(page, 'another customer');
// Check for expected results