Skip to content

Commit ca85e01

Browse files
committed
Add failing test
1 parent df56bdb commit ca85e01

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/OnTypeFormattingTest.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,44 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting;
1818
public class OnTypeFormattingTest(FormattingTestContext context, HtmlFormattingFixture fixture, ITestOutputHelper testOutput)
1919
: FormattingTestBase(context, fixture.Service, testOutput), IClassFixture<FormattingTestContext>
2020
{
21+
[FormattingTestFact]
22+
public async Task FormatsElseCloseBrace()
23+
{
24+
await RunOnTypeFormattingTestAsync(
25+
input: """
26+
@page "/"
27+
28+
@if (true)
29+
{
30+
<option value="@streetKind">@streetKind</option>
31+
}
32+
else {
33+
<input />
34+
}$$
35+
36+
@code {
37+
private string? streetKind;
38+
}
39+
""",
40+
expected: """
41+
@page "/"
42+
43+
@if (true)
44+
{
45+
<option value="@streetKind">@streetKind</option>
46+
}
47+
else
48+
{
49+
<input />
50+
}
51+
52+
@code {
53+
private string? streetKind;
54+
}
55+
""",
56+
triggerCharacter: '}');
57+
}
58+
2159
[FormattingTestFact]
2260
public async Task FormatsIfStatementInComponent()
2361
{

0 commit comments

Comments
 (0)