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

Fix TestSceneNewsYearsPanel error

This commit is contained in:
Andrei Zavatski 2021-05-11 16:54:19 +03:00
parent c2ba16f977
commit b79a0237a3

View File

@ -22,24 +22,21 @@ namespace osu.Game.Tests.Visual.Online
private YearsPanel panel;
[SetUp]
public void SetUp()
{
Child = panel = new YearsPanel
public void SetUp() => Schedule(() => Child = panel = new YearsPanel
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
}
});
[Test]
public void TestVisibility()
{
AddStep("Change metadata to null", () => metadataBindable.Value = null);
AddAssert("Panel is hidden", () => !panel.IsPresent);
AddUntilStep("Panel is hidden", () => panel?.Alpha == 0);
AddStep("Change metadata", () => metadataBindable.Value = metadata);
AddAssert("Panel is visible", () => panel.IsPresent);
AddUntilStep("Panel is visible", () => panel?.Alpha == 1);
AddStep("Change metadata to null", () => metadataBindable.Value = null);
AddAssert("Panel is hidden", () => !panel.IsPresent);
AddUntilStep("Panel is hidden", () => panel?.Alpha == 0);
}
private static readonly APINewsSidebar metadata = new APINewsSidebar