mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Merge pull request #14202 from gagahpangeran/changelog-supporter
Add supporter promo section in changelog overlay
This commit is contained in:
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Humanizer;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
@ -95,9 +96,11 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddAssert(@"no stream selected", () => changelog.Header.Streams.Current.Value == null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShowWithBuild()
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void ShowWithBuild(bool isSupporter)
|
||||
{
|
||||
AddStep(@"set supporter", () => dummyAPI.LocalUser.Value.IsSupporter = isSupporter);
|
||||
showBuild(() => new APIChangelogBuild
|
||||
{
|
||||
Version = "2018.712.0",
|
||||
@ -155,6 +158,8 @@ 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 == 5);
|
||||
AddUntilStep(@"wait for content load", () => changelog.ChildrenOfType<ChangelogSupporterPromo>().Any());
|
||||
AddAssert(@"supporter promo showed", () => changelog.ChildrenOfType<ChangelogSupporterPromo>().First().Alpha == (isSupporter ? 0 : 1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -0,0 +1,35 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Changelog;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestSceneChangelogSupporterPromo : OsuTestScene
|
||||
{
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
||||
|
||||
public TestSceneChangelogSupporterPromo()
|
||||
{
|
||||
Child = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colourProvider.Background4,
|
||||
},
|
||||
new ChangelogSupporterPromo(),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user