Consent page: Withdraw whenever any live receipt exists, Agree whenever none is live for the version in force

An account on an older receipt sees both buttons.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-11 11:33:51 +00:00
commit c9387a255d
2 changed files with 11 additions and 6 deletions

View file

@ -148,7 +148,7 @@ public sealed class ConsentTests(RegistrationGateFactory factory) : IClassFixtur
}
[Fact]
public async Task Agreement_to_an_older_version_says_it_no_longer_counts_and_offers_agree()
public async Task Agreement_to_an_older_version_says_it_no_longer_counts_and_offers_both_agree_and_withdraw()
{
var identity = NewIdentity();
Seed(identity, (1, Agreed, null));
@ -156,7 +156,7 @@ public sealed class ConsentTests(RegistrationGateFactory factory) : IClassFixtur
Assert.Contains($"You agreed to version 1 on 2026-11-01T12:30:05Z; version {TrainingNotice.Version} is in force and your messages are not used until you agree to it", html);
Assert.Contains("action=\"/auth/bifrost/consent/accept\"", html);
Assert.DoesNotContain("/consent/withdraw", html);
Assert.Contains("action=\"/auth/bifrost/consent/withdraw\"", html);
}
[Fact]