1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Setup basic form flow

This commit is contained in:
Dean Herbert 2023-11-15 20:00:22 +09:00
parent 80c879e5eb
commit e9d4cf2e24
No known key found for this signature in database
3 changed files with 23 additions and 1 deletions

View File

@ -36,6 +36,19 @@ namespace osu.Game.Tests.Visual.Menus
AddStep("show login overlay", () => loginOverlay.Show());
}
[Test]
public void TestLoginTwoFactorSuccess()
{
AddStep("logout", () =>
{
API.Logout();
((DummyAPIAccess)API).RequireTwoFactor();
});
AddStep("enter password", () => loginOverlay.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password");
AddStep("submit", () => loginOverlay.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick());
}
[Test]
public void TestLoginSuccess()
{

View File

@ -21,6 +21,11 @@ using osu.Game.Localisation;
namespace osu.Game.Overlays.Login
{
public partial class AccountVerificationForm : FillFlowContainer
{
}
public partial class LoginForm : FillFlowContainer
{
private TextBox username = null!;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Login
{
private bool bounding = true;
private LoginForm? form;
private Drawable? form;
[Resolved]
private OsuColour colours { get; set; } = null!;
@ -81,6 +81,10 @@ namespace osu.Game.Overlays.Login
};
break;
case APIState.RequiresAuthentication:
Child = form = new AccountVerificationForm();
break;
case APIState.Failing:
case APIState.Connecting:
LinkFlowContainer linkFlow;