fix image test

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-05-26 15:04:04 +07:00
parent 47cbbee4d1
commit 71f77eb902
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -106,6 +106,7 @@ needs_cleanup: true
{ {
AddStep("Add absolute image", () => AddStep("Add absolute image", () =>
{ {
markdownContainer.DocumentUrl = "https://osu.ppy.sh";
markdownContainer.Text = "![intro](/wiki/Interface/img/intro-screen.jpg)"; markdownContainer.Text = "![intro](/wiki/Interface/img/intro-screen.jpg)";
}); });
} }
@ -115,6 +116,7 @@ needs_cleanup: true
{ {
AddStep("Add relative image", () => AddStep("Add relative image", () =>
{ {
markdownContainer.DocumentUrl = "https://osu.ppy.sh";
markdownContainer.CurrentPath = "Interface/"; markdownContainer.CurrentPath = "Interface/";
markdownContainer.Text = "![intro](img/intro-screen.jpg)"; markdownContainer.Text = "![intro](img/intro-screen.jpg)";
}); });
@ -125,6 +127,7 @@ needs_cleanup: true
{ {
AddStep("Add paragraph with block image", () => AddStep("Add paragraph with block image", () =>
{ {
markdownContainer.DocumentUrl = "https://osu.ppy.sh";
markdownContainer.CurrentPath = "Interface/"; markdownContainer.CurrentPath = "Interface/";
markdownContainer.Text = @"Line before image markdownContainer.Text = @"Line before image
@ -139,6 +142,7 @@ Line after image";
{ {
AddStep("Add inline image", () => AddStep("Add inline image", () =>
{ {
markdownContainer.DocumentUrl = "https://osu.ppy.sh";
markdownContainer.Text = "![osu! mode icon](/wiki/shared/mode/osu.png) osu!"; markdownContainer.Text = "![osu! mode icon](/wiki/shared/mode/osu.png) osu!";
}); });
} }
@ -147,6 +151,11 @@ Line after image";
{ {
public LinkInline Link; public LinkInline Link;
public new string DocumentUrl
{
set => base.DocumentUrl = value;
}
public override MarkdownTextFlowContainer CreateTextFlow() => new TestMarkdownTextFlowContainer public override MarkdownTextFlowContainer CreateTextFlow() => new TestMarkdownTextFlowContainer
{ {
UrlAdded = link => Link = link, UrlAdded = link => Link = link,
@ -162,6 +171,8 @@ Line after image";
UrlAdded?.Invoke(linkInline); UrlAdded?.Invoke(linkInline);
} }
protected override void AddImage(LinkInline linkInline) => AddDrawable(new WikiMarkdownImage(linkInline));
} }
} }
} }