Skip to content

Commit

Permalink
Fix #10175 : fix 2 services search test nondeterminism (#10176)
Browse files Browse the repository at this point in the history
Apparently, which search service observable emits results first does not depend on the order
in which they are passed into the search. The test however assumed there to be an
order, causing it to break on MacOS. This is now fixed.

On Behalf of DB Systel

Co-authored-by: Florian Kellner <florian.fl.kellner@deutschebahn.com>
  • Loading branch information
fkellner and Florian Kellner committed Aug 29, 2024
1 parent 04e8784 commit 7049fa2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions web/client/epics/__tests__/search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ describe('search Epics', () => {
typeName: 'topp:states',
queriableAttributes: [STATE_NAME],
returnFullData: false
}
},
priority: 2
},
{
type: 'wfs',
Expand All @@ -572,7 +573,8 @@ describe('search Epics', () => {
typeName: 'topp:states',
queriableAttributes: [STATE_NAME],
returnFullData: false
}
},
priority: 1
}],
maxResults
};
Expand All @@ -587,12 +589,12 @@ describe('search Epics', () => {
expect(actions[1].type).toBe(TEXT_SEARCH_LOADING);
expect(actions[2].type).toBe(TEXT_SEARCH_RESULTS_LOADED);
expect(actions[2].results.length).toBe(maxResults);
expect(head(actions[2].results).id).toBe("states.1");
expect(last(actions[2].results).id).toBe("states.5");
expect(head(actions[2].results).id).toMatch(/^(states|states-ari).1$/);
expect(last(actions[2].results).id).toMatch(/^(states|states-ari).5$/);
expect(actions[3].type).toBe(TEXT_SEARCH_RESULTS_LOADED);
expect(actions[3].results.length).toBe(maxResults);
expect(head(actions[3].results).id).toBe("states.1");
expect(last(actions[3].results).id).toBe("states.5");
expect(head(actions[3].results).id).toBe("states-ari.1");
expect(last(actions[3].results).id).toBe("states-ari.5");
expect(actions[4].type).toBe(TEXT_SEARCH_LOADING);
done();
}, {});
Expand Down

0 comments on commit 7049fa2

Please sign in to comment.