mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
@ -7,6 +7,7 @@ using osu.Game.Overlays.Comments;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -20,7 +21,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[Cached]
|
||||
private LoginOverlay login;
|
||||
|
||||
private VotePill votePill;
|
||||
private TestPill votePill;
|
||||
private readonly Container pillContainer;
|
||||
|
||||
public TestSceneVotePill()
|
||||
@ -43,7 +44,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Hide login overlay", () => login.Hide());
|
||||
AddStep("Log in", logIn);
|
||||
AddStep("User comment", () => addVotePill(getUserComment()));
|
||||
AddAssert("Is disabled", () => !votePill.Enabled.Value);
|
||||
AddAssert("Background is transparent", () => votePill.Background.Alpha == 0);
|
||||
AddStep("Click", () => votePill.Click());
|
||||
AddAssert("Not loading", () => !votePill.IsLoading);
|
||||
}
|
||||
@ -54,7 +55,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Hide login overlay", () => login.Hide());
|
||||
AddStep("Log in", logIn);
|
||||
AddStep("Random comment", () => addVotePill(getRandomComment()));
|
||||
AddAssert("Is enabled", () => votePill.Enabled.Value);
|
||||
AddAssert("Background is visible", () => votePill.Background.Alpha == 1);
|
||||
AddStep("Click", () => votePill.Click());
|
||||
AddAssert("Loading", () => votePill.IsLoading);
|
||||
}
|
||||
@ -88,11 +89,21 @@ namespace osu.Game.Tests.Visual.Online
|
||||
private void addVotePill(Comment comment)
|
||||
{
|
||||
pillContainer.Clear();
|
||||
pillContainer.Child = votePill = new VotePill(comment)
|
||||
pillContainer.Child = votePill = new TestPill(comment)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
};
|
||||
}
|
||||
|
||||
private class TestPill : VotePill
|
||||
{
|
||||
public new Box Background => base.Background;
|
||||
|
||||
public TestPill(Comment comment)
|
||||
: base(comment)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user