Skip to content

Commit

Permalink
Use AddUntilStep to wait for channel to load and become visible
Browse files Browse the repository at this point in the history
  • Loading branch information
jai-x committed May 9, 2022
1 parent d4cc2bd commit ebb64d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions osu.Game.Tests/Visual/Online/TestSceneChatOverlayV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void TestBasic()
channelManager.CurrentChannel.Value = joinedChannel;
});
AddAssert("Overlay is visible", () => chatOverlay.State.Value == Visibility.Visible);
AddAssert("Channel is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
AddUntilStep("Channel is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
}

[Test]
Expand Down Expand Up @@ -174,7 +174,7 @@ public void TestChannelSelection()
AddAssert("Listing is visible", () => listingIsVisible);
AddStep("Join channel 1", () => channelManager.JoinChannel(testChannel1));
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
AddAssert("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
AddUntilStep("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
}

[Test]
Expand Down Expand Up @@ -273,7 +273,7 @@ public void TestHighlightOnCurrentChannel()
});
});
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message, testChannel1));
AddAssert("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
AddUntilStep("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
}

[Test]
Expand All @@ -296,7 +296,7 @@ public void TestHighlightOnAnotherChannel()
});
});
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message, testChannel2));
AddAssert("Channel 2 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel2);
AddUntilStep("Channel 2 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel2);
}

[Test]
Expand All @@ -320,7 +320,7 @@ public void TestHighlightOnLeftChannel()
});
AddStep("Leave channel 2", () => channelManager.LeaveChannel(testChannel2));
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message, testChannel2));
AddAssert("Channel 2 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel2);
AddUntilStep("Channel 2 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel2);
}

[Test]
Expand All @@ -340,7 +340,7 @@ public void TestHighlightWhileChatNeverOpen()
});
});
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message, testChannel1));
AddAssert("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
AddUntilStep("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
}

[Test]
Expand All @@ -361,7 +361,7 @@ public void TestHighlightWithNullChannel()
});
AddStep("Set null channel", () => channelManager.CurrentChannel.Value = null);
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message, testChannel1));
AddAssert("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
AddUntilStep("Channel 1 is visible", () => channelIsVisible && currentDrawableChannel.Channel == testChannel1);
}

[Test]
Expand Down

0 comments on commit ebb64d1

Please sign in to comment.