From a6b237f4b08a6c85cb88b37c5494c89343d2a0ca Mon Sep 17 00:00:00 2001 From: Andre Wanlin Date: Fri, 10 Nov 2023 17:51:34 -0600 Subject: [PATCH] chore: fix failing test Signed-off-by: Andre Wanlin --- packages/app/src/App.test.tsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/app/src/App.test.tsx b/packages/app/src/App.test.tsx index 82bc47985..e8a132eed 100644 --- a/packages/app/src/App.test.tsx +++ b/packages/app/src/App.test.tsx @@ -3,16 +3,33 @@ import { renderWithEffects } from '@backstage/test-utils'; import App from './App'; describe('App', () => { + + const mockRandomUUID = () => + '068f3129-7440-4e0e-8fd4-xxxxxxxxxxxx'.replace( + /x/g, + () => Math.floor(Math.random() * 16).toString(16), // 0x0 to 0xf + ) as `${string}-${string}-${string}-${string}-${string}`; + + beforeEach(() => { + window.crypto.randomUUID = mockRandomUUID; + }); + it('should render', async () => { process.env = { NODE_ENV: 'test', APP_CONFIG: [ { data: { - app: { title: 'Test' }, - backend: { baseUrl: 'http://localhost:7000' }, + app: { + title: 'Test', + support: { url: 'http://localhost:7007/support' }, + }, + backend: { baseUrl: 'http://localhost:7007' }, + lighthouse: { + baseUrl: 'http://localhost:3003', + }, techdocs: { - storageUrl: 'http://localhost:7000/api/techdocs/static/docs', + storageUrl: 'http://localhost:7007/api/techdocs/static/docs', }, }, context: 'test',