We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27c115f commit 98b5020Copy full SHA for 98b5020
code/frontend/src/pages/layout/Layout.test.tsx
@@ -1,3 +1,8 @@
1
+/**
2
+ * @jest-environment jsdom
3
+ * @jest-environment-options {"url": "http://NonDeloyed/"}
4
+ */
5
+
6
import {
7
render,
8
screen,
@@ -66,11 +71,8 @@ describe("Layout Component", () => {
66
71
67
72
test('test the auth branching auth is true case', async () => {
68
73
const mocklist: any[] = [];
69
- Object.defineProperty(window, "location", {
70
- value: {
- hostname: "NonDeloyed"
- },
- });
74
75
+ // Test with jsdom environment configured for NonDeloyed hostname
76
;(getUserInfo as jest.Mock).mockResolvedValue(mocklist)
77
;(checkAuthEnforced as jest.Mock).mockResolvedValue(true)
78
await act(async () => {
0 commit comments