Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crashing compilation page on OWIN #1796

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Framework/Framework/Compilation/DotHtmlFileInfo.cs
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ public sealed record CompilationDiagnosticViewModel(
)
{
public string? SourceLine { get; set; } = SourceLine;
public string? SourceLinePrefix => SourceLine?.Remove(ColumnNumber ?? 0);
public string? SourceLinePrefix => SourceLine?.Substring(0, ColumnNumber ?? 0);
public string? SourceLineHighlight =>
HighlightLength is {} len ? SourceLine?.Substring(ColumnNumber ?? 0, len)
: SourceLine?.Substring(ColumnNumber ?? 0);

Unchanged files with check annotations Beta

Thread.Sleep(50);
}
Assert.True(false, "SPA 2 page did not load in time");

Check warning on line 235 in src/Samples/Tests/Tests/Control/UpdateProgressTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, Default)

Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020)

Check warning on line 235 in src/Samples/Tests/Tests/Control/UpdateProgressTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, ExperimentalFeaturesTests)

Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020)

Check warning on line 235 in src/Samples/Tests/Tests/Control/UpdateProgressTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Production, Default)

Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020)

Check warning on line 235 in src/Samples/Tests/Tests/Control/UpdateProgressTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, ExperimentalFeaturesTests)

Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020)

Check warning on line 235 in src/Samples/Tests/Tests/Control/UpdateProgressTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, Default)

Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020)
});
}
[Fact]
var textbox = browser.First("[data-ui=name-textbox]");
submitButton.Click();
Assert.Equal(0, validationSummary.Children.Count);

Check warning on line 702 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 702 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 702 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
AssertUI.HasNotClass(textbox, "has-error");
textbox.SendKeys("123");
submitButton.Click();
AssertUI.HasClass(textbox, "has-error");
Assert.Equal(1, validationSummary.Children.Count);

Check warning on line 708 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Single instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 708 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Single instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
textbox.Clear();
textbox.SendKeys("Ted");
submitButton.Click();
Assert.Equal(0, validationSummary.Children.Count);

Check warning on line 713 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
AssertUI.HasNotClass(textbox, "has-error");
textbox.SendKeys("123");
submitButton.Click();
AssertUI.HasClass(textbox, "has-error");
Assert.Equal(1, validationSummary.Children.Count);

Check warning on line 721 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Single instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
});
}
var validateButton = browser.First("[data-ui=validation-button]");
var validationSummary = browser.First("[data-ui=validation-summary]");
Assert.Equal(0, validationSummary.Children.Count);

Check warning on line 734 in src/Samples/Tests/Tests/Feature/ValidationTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
validateButton.Click();
Assert.Equal(2, validationSummary.Children.Count);
var clientRepeater = browser.Single("client-repeater", this.SelectByDataUi);
var serverRepeater = browser.Single("server-repeater", this.SelectByDataUi);
Assert.Equal(0, clientRepeater.Children.Count);

Check warning on line 28 in src/Samples/Tests/Tests/Control/RepeaterTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 28 in src/Samples/Tests/Tests/Control/RepeaterTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
Assert.Equal(0, serverRepeater.Children.Count);

Check warning on line 29 in src/Samples/Tests/Tests/Control/RepeaterTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 29 in src/Samples/Tests/Tests/Control/RepeaterTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Production, Default)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
var button = browser.Single("set-collection-button", this.SelectByDataUi);
button.Click();
AssertUI.ContainsElement(gridView, "thead");
AssertUI.ContainsElement(gridView, "tbody");
}, browser => {
Assert.Equal(0, browser.FindElements("gridView", this.SelectByDataUi).Count);

Check warning on line 23 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 23 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
});
}
AssertUI.IsDisplayed(message);
AssertUI.TextEquals(message, "There are no Customers to display");
}, browser => {
Assert.Equal(0, browser.FindElements(gridViewDataUi).Count);

Check warning on line 40 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)

Check warning on line 40 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
Assert.Equal(0, browser.FindElements(messageDataUi).Count);

Check warning on line 41 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
});
}
AssertUI.IsDisplayed(literal);
AssertUI.TextEquals(literal, "Test 1");
}, browser => {
Assert.Equal(0, browser.FindElements("literal", this.SelectByDataUi).Count);

Check warning on line 54 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
});
}
AssertUI.IsDisplayed(literal);
}
}, browser => {
Assert.Equal(0, browser.FindElements("literal-repeater", this.SelectByDataUi).Count);

Check warning on line 70 in src/Samples/Tests/Tests/Control/IncludeInPagePropertyTests.cs

GitHub Actions / UI tests (chrome, ubuntu-latest, Production, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
});
}
browser.WaitUntilDotvvmInited();
var checkBoxes = browser.FindElements("checkbox", SelectByDataUi);
Assert.Equal(0, checkBoxes.Count);

Check warning on line 152 in src/Samples/Tests/Tests/Control/CheckBoxTests.cs

GitHub Actions / UI tests (firefox, ubuntu-latest, Development, ExperimentalFeaturesTests)

Do not use Assert.Equal() to check for collection size. Use Assert.Empty instead. (https://xunit.net/xunit.analyzers/rules/xUnit2013)
void UpdateData() => browser.WaitFor(() => {
var button = browser.First("btn-update", SelectByDataUi).Click();
var repeater = browser.Single("repeater", SelectByDataUi);