mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 22:01:52 +00:00
Fixed test by using different serverId every time, preventing memoization
This commit is contained in:
@@ -18,6 +18,11 @@ const versionToSemVer = pipe(
|
||||
toSemVer(MIN_FALLBACK_VERSION)
|
||||
);
|
||||
|
||||
const getServerVersion = memoizeWith(identity, (serverId, health) => health().then(({ version }) => ({
|
||||
version: versionToSemVer(version),
|
||||
printableVersion: versionToPrintable(version),
|
||||
})));
|
||||
|
||||
export const resetSelectedServer = createAction(RESET_SELECTED_SERVER);
|
||||
|
||||
export const selectServer = ({ findServerById }, buildShlinkApiClient) => (serverId) => async (dispatch) => {
|
||||
@@ -54,11 +59,6 @@ export const selectServer = ({ findServerById }, buildShlinkApiClient) => (serve
|
||||
}
|
||||
};
|
||||
|
||||
const getServerVersion = memoizeWith(identity, (serverId, health) => health().then(({ version }) => ({
|
||||
version: versionToSemVer(version),
|
||||
printableVersion: versionToPrintable(version),
|
||||
})));
|
||||
|
||||
export default handleActions({
|
||||
[RESET_SELECTED_SERVER]: () => initialState,
|
||||
[SELECT_SERVER]: (state, { selectedServer }) => selectedServer,
|
||||
|
||||
Reference in New Issue
Block a user