mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 18:13:09 +08:00
Fix chat command test as reference equality checks on PM channels doesn't seem to to work
This commit is contained in:
parent
4bd1d09148
commit
bcce807311
@ -185,16 +185,17 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep("Join channel 1", () => channelManager.JoinChannel(testChannel1));
|
AddStep("Join channel 1", () => channelManager.JoinChannel(testChannel1));
|
||||||
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
|
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
|
||||||
AddStep("Open chat with user", () => channelManager.PostCommand($"chat {testUser.Username}"));
|
AddStep("Open chat with user", () => channelManager.PostCommand($"chat {testUser.Username}"));
|
||||||
AddAssert("PM channel is selected", () => channelManager.CurrentChannel.Value == testPMChannel);
|
AddAssert("PM channel is selected", () =>
|
||||||
AddAssert("PM channel is visibile", () => currentDrawableChannel.Channel == testPMChannel);
|
channelManager.CurrentChannel.Value.Type == ChannelType.PM && channelManager.CurrentChannel.Value.Users.Single() == testUser);
|
||||||
AddStep("Open chat with non-existent user", () => channelManager.PostCommand("chat user_doesnt_exist"));
|
AddStep("Open chat with non-existent user", () => channelManager.PostCommand("chat user_doesnt_exist"));
|
||||||
AddAssert("Last message is error", () => channelManager.CurrentChannel.Value.Messages.Last() is ErrorMessage);
|
AddAssert("Last message is error", () => channelManager.CurrentChannel.Value.Messages.Last() is ErrorMessage);
|
||||||
|
|
||||||
// Make sure no unnecessary requests are made when the PM channel is already open.
|
// Make sure no unnecessary requests are made when the PM channel is already open.
|
||||||
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
|
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
|
||||||
AddStep("Unregister request handling", () => ((DummyAPIAccess)API).HandleRequest = null);
|
AddStep("Unregister request handling", () => ((DummyAPIAccess)API).HandleRequest = null);
|
||||||
AddStep("Open chat with user", () => channelManager.PostCommand($"chat {testUser.Username}"));
|
AddStep("Open chat with user", () => channelManager.PostCommand($"chat {testUser.Username}"));
|
||||||
AddAssert("PM channel is selected", () => channelManager.CurrentChannel.Value == testPMChannel);
|
AddAssert("PM channel is selected", () =>
|
||||||
AddAssert("PM channel is visibile", () => currentDrawableChannel.Channel == testPMChannel);
|
channelManager.CurrentChannel.Value.Type == ChannelType.PM && channelManager.CurrentChannel.Value.Users.Single() == testUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user