1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:23:22 +08:00

Test steps rearrangement and condition fix

This commit is contained in:
Andrei Zavatski 2019-10-30 04:16:14 +03:00
parent 7f755fe726
commit 8ad5ccda68
2 changed files with 9 additions and 6 deletions

View File

@ -27,24 +27,27 @@ namespace osu.Game.Tests.Visual.Online
var userComment = new Comment
{
IsVoted = false,
UserId = API.LocalUser.Value?.Id,
UserId = API.LocalUser.Value.Id,
VotesCount = 10,
};
var randomComment = new Comment
{
IsVoted = false,
UserId = 455454,
UserId = 4444,
VotesCount = 2,
};
AddStep("User comment", () => addVotePill(userComment));
AddStep("Click", () => votePill.Click());
AddAssert("Not loading", () => votePill.IsLoading == false);
AddStep("Random comment", () => addVotePill(randomComment));
AddStep("Click", () => votePill.Click());
AddAssert("Loading", () => votePill.IsLoading == true);
AddStep("User comment", () => addVotePill(userComment));
AddStep("Click", () => votePill.Click());
AddAssert("Not loading", () => votePill.IsLoading == false);
AddStep("Log out", API.Logout);
AddStep("Random comment", () => addVotePill(randomComment));
AddStep("Click", () => votePill.Click());
AddAssert("Not loading", () => votePill.IsLoading == false);
}

View File

@ -59,7 +59,7 @@ namespace osu.Game.Overlays.Comments
AccentColour = borderContainer.BorderColour = sideNumber.Colour = colours.GreenLight;
hoverLayer.Colour = Color4.Black.Opacity(0.5f);
if ((api.LocalUser.Value?.Id ?? comment.UserId) != comment.UserId)
if (api.LocalUser.Value.Id != comment.UserId && api.LocalUser.Value.Id != 1)
Action = onAction;
}