Skip to content

Commit 44bcc4f

Browse files
filzrevp-kostov
authored andcommitted
chore: Skip unstable PlantUML tests (dotnet#9858)
* chore: skip unstable plantuml test * chore: change svg content assertion logics
1 parent f04d7d8 commit 44bcc4f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

test/Docfx.MarkdigEngine.Extensions.Tests/PlantUmlTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using FluentAssertions;
45
using Xunit;
56

67
namespace Docfx.MarkdigEngine.Tests;
@@ -18,14 +19,13 @@ public void TestRenderSvg_SequenceDiagram()
1819
```
1920
""";
2021

21-
var expected = """
22-
<div class="lang-plantUml"><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="120px" preserveAspectRatio="none" style="width:113px;height:120px;background:#FFFFFF;" version="1.1" viewBox="0 0 113 120" width="113px" zoomAndPan="magnify"><defs/><g><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="26" x2="26" y1="36.2969" y2="85.4297"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="82" x2="82" y1="36.2969" y2="85.4297"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="43" x="5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="29" x="12" y="24.9951">Bob</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="43" x="5" y="84.4297"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="29" x="12" y="104.4248">Bob</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="49" x="58" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="35" x="65" y="24.9951">Alice</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="49" x="58" y="84.4297"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="35" x="65" y="104.4248">Alice</text><polygon fill="#181818" points="70.5,63.4297,80.5,67.4297,70.5,71.4297,74.5,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="26.5" x2="76.5" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="33.5" y="62.3638">hello</text><!--SRC=[SyfFKj2rKt3CoKnELR1Io4ZDoSa70000]--></g></svg></div>
23-
""";
24-
25-
TestUtility.VerifyMarkup(source, expected, plantUml: new()
22+
var result = TestUtility.VerifyMarkup(source, html: null, plantUml: new()
2623
{
2724
OutputFormat = PlantUml.Net.OutputFormat.Svg,
2825
RemoteUrl = "https://www.plantuml.com/plantuml",
29-
});
26+
}).TrimEnd();
27+
28+
result.Should().StartWith("""<div class="lang-plantUml"><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg""");
29+
result.Should().EndWith("""hello</text><!--SRC=[SyfFKj2rKt3CoKnELR1Io4ZDoSa70000]--></g></svg></div>""");
3030
}
3131
}

test/Docfx.MarkdigEngine.Extensions.Tests/TestUtility.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Docfx.MarkdigEngine.Tests;
1010

1111
public static class TestUtility
1212
{
13-
public static void VerifyMarkup(
13+
public static string VerifyMarkup(
1414
string markdown,
1515
string html,
1616
string[] errors = null,
@@ -68,6 +68,7 @@ public static void VerifyMarkup(
6868
{
6969
Assert.Equal(dependencies.OrderBy(_ => _), actualDependencies.OrderBy(_ => _));
7070
}
71+
return actualHtml;
7172
}
7273

7374
MarkdownContext.LogActionDelegate Log(string level)

0 commit comments

Comments
 (0)