mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Fix various tests failing due to dependence on specific online data
This commit is contained in:
parent
323da82477
commit
66a23c22e5
@ -41,6 +41,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore("needs to be updated to not be so server dependent")]
|
||||
public void ShowWithBuild()
|
||||
{
|
||||
AddStep(@"Show with Lazer 2018.712.0", () =>
|
||||
@ -49,7 +50,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
Version = "2018.712.0",
|
||||
DisplayVersion = "2018.712.0",
|
||||
UpdateStream = new APIUpdateStream { Id = 7, Name = OsuGameBase.CLIENT_STREAM_NAME },
|
||||
UpdateStream = new APIUpdateStream { Id = 5, Name = OsuGameBase.CLIENT_STREAM_NAME },
|
||||
ChangelogEntries = new List<APIChangelogEntry>
|
||||
{
|
||||
new APIChangelogEntry
|
||||
@ -64,7 +65,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
AddUntilStep(@"wait for streams", () => changelog.Streams?.Count > 0);
|
||||
AddAssert(@"correct build displayed", () => changelog.Current.Value.Version == "2018.712.0");
|
||||
AddAssert(@"correct stream selected", () => changelog.Header.Streams.Current.Value.Id == 7);
|
||||
AddAssert(@"correct stream selected", () => changelog.Header.Streams.Current.Value.Id == 5);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Run command", () => Add(new NowPlayingCommand()));
|
||||
|
||||
if (hasOnlineId)
|
||||
AddAssert("Check link presence", () => postTarget.LastMessage.Contains("https://osu.ppy.sh/b/1234"));
|
||||
AddAssert("Check link presence", () => postTarget.LastMessage.Contains("/b/1234"));
|
||||
else
|
||||
AddAssert("Check link not present", () => !postTarget.LastMessage.Contains("https://"));
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public enum ChangelogEntryType
|
||||
{
|
||||
Add,
|
||||
Fix
|
||||
Fix,
|
||||
Misc
|
||||
}
|
||||
}
|
||||
|
@ -131,33 +131,36 @@ namespace osu.Game.Overlays.Changelog
|
||||
t.Padding = new MarginPadding { Left = 10 };
|
||||
});
|
||||
|
||||
if (entry.GithubUser.UserId != null)
|
||||
if (entry.GithubUser != null)
|
||||
{
|
||||
title.AddUserLink(new User
|
||||
if (entry.GithubUser.UserId != null)
|
||||
{
|
||||
Username = entry.GithubUser.OsuUsername,
|
||||
Id = entry.GithubUser.UserId.Value
|
||||
}, t =>
|
||||
title.AddUserLink(new User
|
||||
{
|
||||
Username = entry.GithubUser.OsuUsername,
|
||||
Id = entry.GithubUser.UserId.Value
|
||||
}, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else if (entry.GithubUser.GithubUrl != null)
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else if (entry.GithubUser.GithubUrl != null)
|
||||
{
|
||||
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
|
||||
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
title.AddText(entry.GithubUser.DisplayName, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
title.AddText(entry.GithubUser.DisplayName, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ChangelogEntries.Add(titleContainer);
|
||||
|
@ -86,6 +86,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
public void ShowListing()
|
||||
|
||||
{
|
||||
Current.Value = null;
|
||||
Show();
|
||||
|
Loading…
Reference in New Issue
Block a user