Skip to content

Commit dac224b

Browse files
committed
Remove mocking
1 parent b3e1b5c commit dac224b

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

client/src/components/__tests__/AuthDebugger.test.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ Object.defineProperty(window, "sessionStorage", {
8484
value: sessionStorageMock,
8585
});
8686

87-
Object.defineProperty(window, "location", {
88-
value: {
89-
origin: "http://localhost:3000",
90-
},
91-
configurable: true,
92-
writable: true,
93-
});
94-
9587
describe("AuthDebugger", () => {
9688
const defaultAuthState = EMPTY_DEBUGGER_STATE;
9789

@@ -106,7 +98,7 @@ describe("AuthDebugger", () => {
10698
jest.clearAllMocks();
10799
sessionStorageMock.getItem.mockReturnValue(null);
108100

109-
// Supress
101+
// Suppress console errors in tests to avoid JSDOM navigation noise
110102
jest.spyOn(console, "error").mockImplementation(() => {});
111103

112104
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
@@ -449,18 +441,6 @@ describe("AuthDebugger", () => {
449441
it("should store auth state to sessionStorage before redirect in Quick OAuth Flow", async () => {
450442
const updateAuthState = jest.fn();
451443

452-
// Mock window.location.href setter
453-
const originalLocation = window.location;
454-
const locationMock = {
455-
...originalLocation,
456-
href: "",
457-
origin: "http://localhost:3000",
458-
};
459-
Object.defineProperty(window, "location", {
460-
writable: true,
461-
value: locationMock,
462-
});
463-
464444
// Setup mocks for OAuth flow
465445
mockStartAuthorization.mockResolvedValue({
466446
authorizationUrl: new URL(

0 commit comments

Comments
 (0)