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:
2026-08-18 20:47:36 +00:00
parent 4ce02ee569
commit 1f03b83db1
2 changed files with 18 additions and 4 deletions
@@ -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);
}