feat(editor): Use remote filtering for error workflow search in settings (#17624)

This commit is contained in:
Guillaume Jacquart
2025-07-28 10:34:46 +02:00
committed by GitHub
parent a9c29e340a
commit e1ef35a2b4
3 changed files with 32 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ let settingsStore: MockedStore<typeof useSettingsStore>;
let sourceControlStore: MockedStore<typeof useSourceControlStore>;
let pinia: ReturnType<typeof createTestingPinia>;
let fetchAllWorkflowsSpy: MockInstance<(typeof workflowsStore)['fetchAllWorkflows']>;
let searchWorkflowsSpy: MockInstance<(typeof workflowsStore)['searchWorkflows']>;
const createComponent = createComponentRenderer(WorkflowSettingsVue, {
global: {
@@ -55,7 +55,7 @@ describe('WorkflowSettingsVue', () => {
} as FrontendSettings;
workflowsStore.workflowName = 'Test Workflow';
workflowsStore.workflowId = '1';
fetchAllWorkflowsSpy = workflowsStore.fetchAllWorkflows.mockResolvedValue([
searchWorkflowsSpy = workflowsStore.searchWorkflows.mockResolvedValue([
{
id: '1',
name: 'Test Workflow',
@@ -134,8 +134,12 @@ describe('WorkflowSettingsVue', () => {
// first is `- No Workflow -`, second is the workflow returned by
// `workflowsStore.fetchAllWorkflows`
expect(dropdownItems).toHaveLength(2);
expect(fetchAllWorkflowsSpy).toHaveBeenCalledTimes(1);
expect(fetchAllWorkflowsSpy).toHaveBeenCalledWith();
expect(searchWorkflowsSpy).toHaveBeenCalledTimes(1);
expect(searchWorkflowsSpy).toHaveBeenCalledWith(
expect.objectContaining({
name: undefined,
}),
);
});
it('should not remove valid workflow ID characters', async () => {