mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(editor): Handle Leading Spaces in Workflow Search (#13889)
This commit is contained in:
@@ -247,5 +247,21 @@ describe('NodesListPanel', () => {
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9);
|
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should trim search input before emitting update', async () => {
|
||||||
|
renderComponent();
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
|
expect(screen.queryByTestId('node-creator-search-bar')).toBeInTheDocument();
|
||||||
|
await fireEvent.input(screen.getByTestId('node-creator-search-bar'), {
|
||||||
|
target: { value: ' Node 1' },
|
||||||
|
});
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
|
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(1);
|
||||||
|
expect(screen.queryByText('Node 1')).toBeInTheDocument();
|
||||||
|
|
||||||
|
expect(screen.getByTestId('node-creator-search-bar')).toHaveValue('Node 1');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function focus() {
|
|||||||
|
|
||||||
function onInput(event: Event) {
|
function onInput(event: Event) {
|
||||||
const input = event.target as HTMLInputElement;
|
const input = event.target as HTMLInputElement;
|
||||||
emit('update:modelValue', input.value);
|
emit('update:modelValue', input.value.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
|||||||
Reference in New Issue
Block a user