mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-24 23:22:38 +08:00
fix(editor): Make AI Agent appear before Magento 2 when typing agent (#15302)
This commit is contained in:
@@ -2,8 +2,13 @@ import topLevel from './snapshots/toplevel.snapshot.json';
|
||||
import { sublimeSearch } from './sublimeSearch';
|
||||
|
||||
describe('sublimeSearch', () => {
|
||||
describe('search finds at least one match', () => {
|
||||
const testCases: Array<[string, string[]]> = [['agent', ['Magento 2', 'AI Agent']]];
|
||||
describe('search finds specific matches first', () => {
|
||||
// Note that this only tests the order of the specified matches
|
||||
// Further results may appear after the listed ones
|
||||
const testCases: Array<[string, string[]]> = [
|
||||
['set', ['Edit Fields (Set)']],
|
||||
['agent', ['AI Agent', 'Magento 2']],
|
||||
];
|
||||
|
||||
test.each(testCases)(
|
||||
'should return at least "$expectedOrder" for filter "$filter"',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
const SEQUENTIAL_BONUS = 60; // bonus for adjacent matches
|
||||
const SEPARATOR_BONUS = 30; // bonus if match occurs after a separator
|
||||
const SEPARATOR_BONUS = 38; // bonus if match occurs after a separator
|
||||
const CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower
|
||||
const FIRST_LETTER_BONUS = 15; // bonus if the first letter is matched
|
||||
|
||||
|
||||
Reference in New Issue
Block a user