diff --git a/tests/Bifrost.Web.Tests/HeimdallGoogleLinkTests.cs b/tests/Bifrost.Web.Tests/HeimdallGoogleLinkTests.cs index f773eb5..b0e4836 100644 --- a/tests/Bifrost.Web.Tests/HeimdallGoogleLinkTests.cs +++ b/tests/Bifrost.Web.Tests/HeimdallGoogleLinkTests.cs @@ -374,13 +374,12 @@ public sealed class HeimdallGoogleLinkTests Assert.DoesNotContain("now linked to your", hostile); } - // ---- 6. google stays out of sign-in and member access ---- + // ---- 6. google is a sign-in provider, but gives no member access ---- [Theory] - [InlineData("/auth/heimdall/google")] [InlineData("/auth/heimdall/google?access=member")] - [InlineData("/auth/heimdall/Google")] - public async Task Google_is_refused_as_a_sign_in_provider_and_asks_Heimdall_for_nothing(string url) + [InlineData("/auth/heimdall/Google?access=member")] + public async Task Google_is_refused_for_member_access_and_asks_Heimdall_for_nothing(string url) { using var host = new HeimdallHost(realSessions: true); @@ -391,6 +390,17 @@ public sealed class HeimdallGoogleLinkTests Assert.Empty(host.Heimdall.StartBodies); } + [Fact] + public async Task A_plain_google_sign_in_starts_at_Heimdall_with_no_grant_when_no_invite_is_held() + { + using var host = new HeimdallHost(realSessions: true); + + var start = await host.StartAtAsync("/auth/heimdall/google"); + + Assert.NotEqual(ErrorRedirect, Location(start.Response)); + Assert.DoesNotContain("firstLoginGrant", Assert.Single(host.Heimdall.StartBodies)); + } + // ---- 7. nothing secret leaves the request ---- [Fact]