yavsc/src/PostIt.Tests
Paul Schneider 562a8bbd86 test(postit): pin blogs scope on bearer, fix post-refactor tests
Two intertwined jobs here:

1. Diagnostic test for the production 401 we see when PostIt
   talks to Yavsc.Blogs. The hypothesis this test isolates:
   the access token sent on the wire is missing the 'blogs'
   scope that Yavsc.Blogs' BlogScope policy requires (see
   Yavsc.Blogs/Program.cs: RequireClaim(JwtClaimTypes.Scope,
   "blogs")). The test fakes a single HttpMessageHandler,
   captures the outbound bearer, decodes the JWT, and asserts
   the 'scope' claim contains 'blogs'. It does not stand up a
   server, an OIDC stub, or any network listener. Result: the
   scope is present in the access_token we construct, so the
   401 is not on the client side — most likely the IdP at
   Yavsc.Org is not issuing 'blogs' as a recognised scope.

2. Mechanical fix of the three test files that broke during
   the Settings model refactor (PostIt.Settings ->
   PostIt.ViewModels.Settings; ApiUrl -> BusinessApiUrl;
   Scopes/RedirectUri moved under Authentication;
   DefaultDesktopRedirectUri is on AuthenticationSettings in
   the global namespace). Also restored the BaseAddress
   setup that BlogApiClient does in production in
   LoginAndPersistAsync / the reloaded-client path of
   YavscApiClientTests, so the two integration tests that
   call CallAsync("posts") directly don't trip on
   'request URI must be absolute or BaseAddress must be set'.

Test status: 45 / 45 passing in PostIt.Tests.
2026-07-08 19:36:40 +01:00
..
BearerScopeTests.cs test(postit): pin blogs scope on bearer, fix post-refactor tests 2026-07-08 19:36:40 +01:00
Directory.Packages.props Split Directory.Packages.props: shared versions in root, per-product in src/ 2026-06-19 18:51:18 +01:00
FakeAuthorizingBrowser.cs Identity reloaded 2026-07-05 23:56:10 +01:00
OidcStubAuthority.cs Identity reloaded 2026-07-05 23:56:10 +01:00
PostIt.Tests.csproj Exploiting GitVersion 2026-06-28 14:11:26 +01:00
PostItViewModelTests.cs test(postit): pin blogs scope on bearer, fix post-refactor tests 2026-07-08 19:36:40 +01:00
SchemeUrlDetectorTests.cs postit: traceable OIDC login UX + session persistence + 2nd-instance early exit 2026-06-27 12:47:52 +01:00
SettingsLoadTests.cs test(postit): pin blogs scope on bearer, fix post-refactor tests 2026-07-08 19:36:40 +01:00
SignaturePadControlTests.cs a Signature Pad 2026-07-04 14:43:39 +01:00
SignaturePageViewModelTests.cs feat(postit): signature capture page (dev entry, file persistence) 2026-07-04 15:11:22 +01:00
TestApp.cs PostIt testing setup 2026-06-19 16:55:42 +01:00
UnitTest1.cs PostIt testing setup 2026-06-19 16:55:42 +01:00
YavscApiClientTests.cs test(postit): pin blogs scope on bearer, fix post-refactor tests 2026-07-08 19:36:40 +01:00