fix(walkthrough): thread directory into GitLab diff client and fix tests
- Add directory parameter to getGitLabMergeRequestDiff for per-project API base URL override resolution - Mock getGitLabAuth/getEffectiveProviderApiBaseUrl in walkthrough tests - Update auth-check test to mock null auth instead of null client
This commit is contained in:
@@ -62,7 +62,7 @@ async function getGitHubPullRequestDiff(directory, number) {
|
||||
* dispatcher's `resolveGitLabRepoFromDirectory` call and is never re-resolved
|
||||
* here.
|
||||
*/
|
||||
async function getGitLabMergeRequestDiff(repo, number) {
|
||||
async function getGitLabMergeRequestDiff(directory, repo, number) {
|
||||
// Resolve per-project API base override, mirroring getClient() in routes.js.
|
||||
const auth = getGitLabAuth();
|
||||
if (!auth?.accessToken) {
|
||||
@@ -132,7 +132,7 @@ async function getGitLabMergeRequestDiff(repo, number) {
|
||||
export async function getPullRequestDiff(directory, number) {
|
||||
const { repo } = await resolveGitLabRepoFromDirectory(directory);
|
||||
if (repo) {
|
||||
return getGitLabMergeRequestDiff(repo, number);
|
||||
return getGitLabMergeRequestDiff(directory, repo, number);
|
||||
}
|
||||
return getGitHubPullRequestDiff(directory, number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user