Skip to content

Commit

Permalink
chore: fix failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Wanlin <[email protected]>
  • Loading branch information
awanlin committed Nov 10, 2023
1 parent 22720e5 commit a6b237f
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions packages/app/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a6b237f

Please sign in to comment.