test(http): disable XSRF and mock location in HttpClient tests to avoid Domino failures and state leakage#68021
Open
dgp1130 wants to merge 1 commit intoangular:mainfrom
Open
test(http): disable XSRF and mock location in HttpClient tests to avoid Domino failures and state leakage#68021dgp1130 wants to merge 1 commit intoangular:mainfrom
dgp1130 wants to merge 1 commit intoangular:mainfrom
Conversation
…id Domino failures and state leakage The `HttpClient` tests in `client_spec.ts` were failing intermittently in Node/Domino environment because `MockPlatformLocation` defaults to `http://_empty_/`. This valid URL satisfied the URL parser in `xsrfInterceptorFn`, causing it to proceed to cookie extraction which throws `NotYetImplemented` in Domino. To fix this: 1. Disabled XSRF protection in `client_spec.ts` using `withNoXsrfProtection()`, as these tests are not for XSRF. 2. Provided `MockPlatformLocation` with a explicit `startUrl: 'http://localhost/'` to remove state leakage effects and ensure consistency.
atscott
reviewed
Apr 3, 2026
Comment on lines
+26
to
+29
| { | ||
| provide: PlatformLocation, | ||
| useFactory: () => new MockPlatformLocation({startUrl: 'http://localhost/'}), | ||
| }, |
Contributor
There was a problem hiding this comment.
IIRC the default platform location is the one that is compatible with the Navigation API. I believe just providing MOCK_PLATFORM_LOCATION_CONFIG instead should work and keep Navigation working. Not that http client tests need Navigation, but probably safest to keep as a "good example" that retains the most complete set of mocks
Contributor
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
HttpClienttests inclient_spec.tswere failing intermittently in Node/Domino environment becauseMockPlatformLocationdefaults tohttp://_empty_/. This valid URL satisfied the URL parser inxsrfInterceptorFn, causing it to proceed to cookie extraction which throwsNotYetImplementedin Domino.To fix this:
client_spec.tsusingwithNoXsrfProtection(), as these tests are not for XSRF.MockPlatformLocationwith an explicitstartUrl: 'http://localhost/'to remove state leakage effects and ensure consistency.