Get dependency on uuid package back to fix error on non-secure contexts

This commit is contained in:
Alejandro Celaya
2024-10-09 09:27:08 +02:00
parent 1ba2241203
commit 453d245924
7 changed files with 48 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import {
selectedServerReducerCreator,
selectServer as selectServerCreator,
} from '../../../src/servers/reducers/selectedServer';
import { randomUUID } from '../../../src/utils/utils';
describe('selectedServerReducer', () => {
const dispatch = vi.fn();
@@ -40,7 +41,7 @@ describe('selectedServerReducer', () => {
['latest', MAX_FALLBACK_VERSION, 'latest'],
['%invalid_semver%', MIN_FALLBACK_VERSION, '%invalid_semver%'],
])('dispatches proper actions', async (serverVersion, expectedVersion, expectedPrintableVersion) => {
const id = crypto.randomUUID();
const id = randomUUID();
const getState = createGetStateMock(id);
const expectedSelectedServer = {
id,
@@ -59,7 +60,7 @@ describe('selectedServerReducer', () => {
});
it('dispatches error when health endpoint fails', async () => {
const id = crypto.randomUUID();
const id = randomUUID();
const getState = createGetStateMock(id);
const expectedSelectedServer = fromPartial<NonReachableServer>({ id, serverNotReachable: true });
@@ -72,7 +73,7 @@ describe('selectedServerReducer', () => {
});
it('dispatches error when server is not found', async () => {
const id = crypto.randomUUID();
const id = randomUUID();
const getState = vi.fn(() => fromPartial<ShlinkState>({ servers: {} }));
const expectedSelectedServer: NotFoundServer = { serverNotFound: true };