Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(gitlab): images and videos in merge request bodies load #30165

Closedlucianholt97(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/30165/headopened View on GitHub

Showing 8 changed files with 37 additions and 2 deletions (loading 5).

x
0 of 8 viewed, 8 left
25 additions and 2 deletionspackages/source-control-gitlab/src/server/GitLabPullRequestProvider.test.tsModified
View file
@@ -319,6 +319,10 @@
});
​
+const UPLOAD_MARKDOWN = "![clip](/uploads/871cca6041e4d445daf391a8a17d8fb2/clip.mp4)";
+const ABSOLUTE_UPLOAD_MARKDOWN =
+ "![clip](https://gitlab.com/acme/web/uploads/871cca6041e4d445daf391a8a17d8fb2/clip.mp4)";
+​
describe("merge request reads", () => {
const reference = { cwd: "/w", repository: "acme/web", host: "gitlab.com", number: 7 };
const detail = {
@@ -379,6 +383,23 @@
return { provider, checks, forget, calls, host };
});
​
+ it.effect("spells out the uploads a description links relative to its project", () =>
+ Effect.gen(function* () {
+ const provider = yield* make.pipe(
+ Effect.provide(
+ Layer.mock(GitLabPullRequestCli.GitLabPullRequestCli)({
+ listMergeRequestStats: () => Effect.succeed([]),
+ getMergeRequestDetail: () => Effect.succeed({ ...detail, body: UPLOAD_MARKDOWN }),
+ getProjectMergeCapabilities: () =>
+ Effect.succeed({ merge: true, squash: true, rebase: true }),
+ }),
+ ),
+ );
+​
+ expect((yield* provider.getChangeRequest(reference)).body).toBe(ABSOLUTE_UPLOAD_MARKDOWN);