|
14 | 14 | using osu.Game.Overlays;
|
15 | 15 | using osu.Game.Overlays.BeatmapListing;
|
16 | 16 | using osuTK;
|
| 17 | +using osuTK.Input; |
17 | 18 |
|
18 | 19 | namespace osu.Game.Tests.Visual.UserInterface
|
19 | 20 | {
|
20 |
| - public partial class TestSceneBeatmapListingSortTabControl : OsuTestScene |
| 21 | + public partial class TestSceneBeatmapListingSortTabControl : OsuManualInputManagerTestScene |
21 | 22 | {
|
22 | 23 | private readonly BeatmapListingSortTabControl control;
|
23 | 24 |
|
@@ -111,6 +112,29 @@ public void TestResetNoQuery()
|
111 | 112 | resetUsesCriteriaOnCategory(SortCriteria.Updated, SearchCategory.Mine);
|
112 | 113 | }
|
113 | 114 |
|
| 115 | + [Test] |
| 116 | + public void TestSortDirectionOnCriteriaChange() |
| 117 | + { |
| 118 | + AddStep("set category to leaderboard", () => control.Reset(SearchCategory.Leaderboard, false)); |
| 119 | + AddAssert("sort direction is descending", () => control.SortDirection.Value == SortDirection.Descending); |
| 120 | + |
| 121 | + AddStep("click ranked sort button", () => |
| 122 | + { |
| 123 | + InputManager.MoveMouseTo(control.TabControl.ChildrenOfType<BeatmapListingSortTabControl.BeatmapTabButton>().Single(s => s.Active.Value)); |
| 124 | + InputManager.Click(MouseButton.Left); |
| 125 | + }); |
| 126 | + |
| 127 | + AddAssert("sort direction is ascending", () => control.SortDirection.Value == SortDirection.Ascending); |
| 128 | + |
| 129 | + AddStep("click first inactive sort button", () => |
| 130 | + { |
| 131 | + InputManager.MoveMouseTo(control.TabControl.ChildrenOfType<BeatmapListingSortTabControl.BeatmapTabButton>().First(s => !s.Active.Value)); |
| 132 | + InputManager.Click(MouseButton.Left); |
| 133 | + }); |
| 134 | + |
| 135 | + AddAssert("sort direction is descending", () => control.SortDirection.Value == SortDirection.Descending); |
| 136 | + } |
| 137 | + |
114 | 138 | private void criteriaShowsOnCategory(bool expected, SortCriteria criteria, SearchCategory category)
|
115 | 139 | {
|
116 | 140 | AddAssert($"{criteria.ToString().ToLowerInvariant()} {(expected ? "shown" : "not shown")} on {category.ToString().ToLowerInvariant()}", () =>
|
|
0 commit comments