mirror of
https://github.com/ppy/osu
synced 2025-01-01 20:02:14 +00:00
Add coverage of local echo messages performing automatic scrolling
This commit is contained in:
parent
3670bd40c2
commit
b3105fb292
@ -217,6 +217,33 @@ namespace osu.Game.Tests.Visual.Online
|
||||
checkScrolledToBottom();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLocalEchoMessageResetsScroll()
|
||||
{
|
||||
fillChat();
|
||||
|
||||
sendMessage();
|
||||
checkScrolledToBottom();
|
||||
|
||||
AddStep("User scroll up", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(chatDisplay.ScreenSpaceDrawQuad.Centre);
|
||||
InputManager.PressButton(MouseButton.Left);
|
||||
InputManager.MoveMouseTo(chatDisplay.ScreenSpaceDrawQuad.Centre + new Vector2(0, chatDisplay.ScreenSpaceDrawQuad.Height));
|
||||
InputManager.ReleaseButton(MouseButton.Left);
|
||||
});
|
||||
|
||||
checkNotScrolledToBottom();
|
||||
sendMessage();
|
||||
checkNotScrolledToBottom();
|
||||
|
||||
sendLocalMessage();
|
||||
checkScrolledToBottom();
|
||||
|
||||
sendMessage();
|
||||
checkScrolledToBottom();
|
||||
}
|
||||
|
||||
private void fillChat()
|
||||
{
|
||||
AddStep("fill chat", () =>
|
||||
@ -243,6 +270,15 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}));
|
||||
}
|
||||
|
||||
private void sendLocalMessage()
|
||||
{
|
||||
AddStep("send local echo", () => testChannel.AddLocalEcho(new LocalEchoMessage()
|
||||
{
|
||||
Sender = longUsernameUser,
|
||||
Content = "This is a local echo message.",
|
||||
}));
|
||||
}
|
||||
|
||||
private void checkScrolledToBottom() =>
|
||||
AddUntilStep("is scrolled to bottom", () => chatDisplay.ScrolledToBottom);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user