From b79a0237a3b57104df4dfee944ad1d2033af49ce Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 11 May 2021 16:54:19 +0300 Subject: [PATCH] Fix TestSceneNewsYearsPanel error --- .../Visual/Online/TestSceneNewsYearsPanel.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneNewsYearsPanel.cs b/osu.Game.Tests/Visual/Online/TestSceneNewsYearsPanel.cs index 39bb97fe98..3199b83a7d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneNewsYearsPanel.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneNewsYearsPanel.cs @@ -22,24 +22,21 @@ namespace osu.Game.Tests.Visual.Online private YearsPanel panel; [SetUp] - public void SetUp() + public void SetUp() => Schedule(() => Child = panel = new YearsPanel { - Child = panel = new YearsPanel - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre - }; - } + 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