1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Add test coverage for highlighting message on left channel

This commit is contained in:
Salman Ahmed 2022-03-10 21:30:02 +03:00
parent 5315ff794a
commit e419370830

View File

@ -463,6 +463,36 @@ namespace osu.Game.Tests.Visual.Online
});
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message));
AddAssert("Switched to channel 2", () => channelManager.CurrentChannel.Value == channel2);
}
[Test]
public void TestHighlightOnLeftChannel()
{
Message message = null;
AddStep("Join channel 1", () => channelManager.JoinChannel(channel1));
AddStep("Select channel 1", () => clickDrawable(chatOverlay.TabMap[channel1]));
AddStep("Join channel 2", () => channelManager.JoinChannel(channel2));
AddStep("Send message in channel 2", () =>
{
channel2.AddNewMessages(message = new Message
{
ChannelId = channel2.Id,
Content = "Message to highlight!",
Timestamp = DateTimeOffset.Now,
Sender = new APIUser
{
Id = 2,
Username = "Someone",
}
});
});
AddStep("Leave channel 2", () => channelManager.LeaveChannel(channel2));
AddStep("Highlight message", () => chatOverlay.HighlightMessage(message));
AddAssert("Switched to channel 2", () => channelManager.CurrentChannel.Value == channel2);
}
[Test]