Merge pull request #27192 from smoogipoo/mod-search-ignore-whitespace

Adjust search terms for mods
This commit is contained in:
Bartłomiej Dach 2024-02-22 11:41:31 +01:00 committed by GitHub
commit 6770b73e4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -788,7 +788,7 @@ public void TestColumnHidingOnTextFilterChange()
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));
AddStep("set search", () => modSelectOverlay.SearchTerm = "HD");
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 1);
AddAssert("two columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);
AddStep("filter out everything", () => modSelectOverlay.SearchTerm = "Some long search term with no matches");
AddAssert("no columns visible", () => this.ChildrenOfType<ModColumn>().All(col => !col.IsPresent));
@ -812,7 +812,7 @@ public void TestHidingOverlayClearsTextSearch()
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));
AddStep("set search", () => modSelectOverlay.SearchTerm = "fail");
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 1);
AddStep("hide", () => modSelectOverlay.Hide());
AddStep("show", () => modSelectOverlay.Show());

View File

@ -77,11 +77,11 @@ protected override void Deselect()
/// <seealso cref="ModState.Visible"/>
public bool Visible => modState.Visible;
public override IEnumerable<LocalisableString> FilterTerms => new[]
public override IEnumerable<LocalisableString> FilterTerms => new LocalisableString[]
{
Mod.Name,
Mod.Name.Replace(" ", string.Empty),
Mod.Acronym,
Mod.Description
};
public override bool MatchingFilter