Skip to content
Snippets Groups Projects
Commit 2113d961 authored by Terri Chu's avatar Terri Chu :nail_care:
Browse files

Use similarity sort in search project dropdown

Changelog: changed
parent d3d80a33
No related branches found
No related tags found
1 merge request!69899Use similarity sort in search project dropdown
Pipeline #367490815 passed
Pipeline: CNG-mirror

#367499897

    ......@@ -40,7 +40,7 @@ export const fetchProjects = ({ commit, state }, search) => {
    );
    } else {
    // The .catch() is due to the API method not handling a rejection properly
    Api.projects(search, { order_by: 'id' }, callback).catch(() => {
    Api.projects(search, { order_by: 'similarity' }, callback).catch(() => {
    callback();
    });
    }
    ......
    ......@@ -142,7 +142,13 @@ describe('Global Search Store Actions', () => {
    actions.fetchProjects({ commit: mockCommit, state });
    expect(Api.groupProjects).not.toHaveBeenCalled();
    expect(Api.projects).toHaveBeenCalled();
    expect(Api.projects).toHaveBeenCalledWith(
    state.query.search,
    {
    order_by: 'similarity',
    },
    expect.any(Function),
    );
    });
    });
    });
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment