Commit graph

33 commits

Author SHA1 Message Date
349ddc03f5 refactor: extract WebHostFixture + TestAuthPolicyProvider to shared lib
Some checks failed
Dotnet build and test / log-the-inputs (pull_request) Has been cancelled
Dotnet build and test / build (pull_request) Has been cancelled
Yavsc.Blogs.Tests will need a fixture too. Lifting the cross-cutting
plumbing (Kestrel + self-signed cert + address discovery + lazy init)
into a new Yavsc.Tests.Shared project lets the next fixture inherit
from it without copying 200+ lines of setup boilerplate, and keeps
the Org.Tests fixture focused on its IdentityServer + SMTP seed.

* New project src/Yavsc.Tests.Shared with WebHostFixture (abstract)
  and TestAuthPolicyProvider (test auth bypass via X-Test-Role).
* WebServerFixture in Org.Tests now inherits from WebHostFixture;
  BuildApp + ConfigurePipelineAsync hold only Org-specific work.
* Two shared package versions promoted to the root Directory.Packages.props.
* Tests still 30/30 green.
2026-07-06 21:33:57 +01:00
dce17888ac code cleanup 2026-07-06 03:31:05 +01:00
333b066e66 Identity reloaded 2026-07-05 23:56:10 +01:00
1751145be8 Exploiting GitVersion 2026-06-28 14:11:26 +01:00
4034c39905 Front matters 2026-06-27 13:30:28 +01:00
002f8cc7e4 Split Directory.Packages.props: shared versions in root, per-product in src/
Move product-local package versions out of the root Directory.Packages.props
into per-product props files under src/<Product>/. The root file now only
contains versions for packages declared by two or more top-level products,
which is the actual shared set.

Each per-product Directory.Packages.props imports the root via
GetPathOfFileAbove so that the shared versions are inherited; this is
necessary because the .NET SDK picks the closest Directory.Packages.props
in the hierarchy and does not merge multiple ones.

Per-product file contents:
- src/cli/                    Microsoft.AspNetCore.Razor.Language,
                              Microsoft.Extensions.{CommandLineUtils,Configuration,Hosting}
- src/PostIt/                 Avalonia* and CommunityToolkit.Mvvm
- src/PostIt.Tests/           Avalonia.Headless{,XUnit}
- src/Yavsc.Org/              AsciiDocSharp*, Google.Apis.Compute.v1,
                              HigginsSoft.IdentityServer8.AspNetIdentity,
                              IdentityServer8.EntityFramework.Storage,
                              IdentityServer8.Security, IdentityServer8.Storage,
                              Microsoft.AspNetCore.Antiforgery, Authentication.Google,
                              Diagnostics.EntityFrameworkCore, Mvc.NewtonsoftJson,
                              SignalR, EntityFrameworkCore.Tools, Swashbuckle,
                              System.Security.Cryptography.Pkcs, YamlDotNet
- src/Yavsc.Org.Tests/        Microsoft.AspNetCore.Hosting,
                              Extensions.Caching.Memory, Options,
                              Options.ConfigurationExtensions,
                              Selenium.WebDriver, xunit.v3.{common,extensibility.core}
- src/Yavsc.Server/           Anthropic.SDK, Google.Apis.Calendar.v3,
                              Magick.NET-Q8-AnyCPU, MailKit, MimeKit,
                              Microsoft.AspNetCore.Http.Features, StaticFiles,
                              EntityFrameworkCore.SqlServer,
                              Npgsql.EntityFrameworkCore.PostgreSQL,
                              PayPalMerchantSDK, pazof.rules, RazorEngine.NetCore
- src/Yavsc.Web/              IdentityModel.AspNetCore

No per-product file is created for Yavsc.Api, Yavsc.Blogs, Yavsc.Abstract,
or templateWeb: Api and Blogs only declare the shared JwtBearer, Abstract
and templateWeb declare no package references at all.

Also includes a minor cosmetic update to FirstUIStript.cs (Firefox -> Chrome
driver, dedent, comment header). Tests previously failing on DataProtection
keyset / SMTP were unrelated environment issues (resolved by fixing the
SMTP password locally).
2026-06-19 18:51:18 +01:00
22b397ce7e Relocate test project: test/yavscTests -> src/Yavsc.Org.Tests
Move the integration test project from the top-level test/ directory into
src/ alongside the projects it tests. Rename the project (and folder) to
Yavsc.Org.Tests to match .NET conventions and reflect that it tests the
Org runtime primarily.

Path changes:
- test/yavscTests/yavscTests.csproj -> src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj
- All .cs / .json / .resx files moved to their new location
- PostItViewModelTests moved out to the dedicated src/PostIt.Tests project
  (it was unrelated to Org testing)

Build adjustments:
- <ProjectReference> paths shortened (..\..\src\X -> ..\X)
- PostIt project reference removed (covered by its own test project)
- <OutputType>exe added (required by xunit.v3)
- xunit.v3.common and xunit.v3.extensibility.core added to package versions

Solution + sln:
- yavsc.sln Project Name updated to 'Yavsc.Org.Tests' and path updated
- GUID preserved so existing build configs stay valid

Static web assets:
- The CopyStaticWebAssetsManifest target was hard-coding the destination
  filename to 'testhost.staticwebassets.endpoints.json', which worked
  when the assembly was named 'yavscTests'. Now that the assembly name
  is 'Yavsc.Org.Tests', ASP.NET Core's MapStaticAssets() looks for
  'Yavsc.Org.Tests.staticwebassets.endpoints.json' (entry-assembly-based
  resolution). Use $(MSBuildProjectName) so the copy target stays
  correct under any future rename.
2026-06-19 17:52:54 +01:00
ad19ccbcfa PostIt testing setup 2026-06-19 16:55:42 +01:00
94fb98eff6 doc, doc and doc. 2026-06-18 02:18:49 +01:00
c1f4d19975 fices the UI 2026-06-15 02:55:22 +01:00
cef6002fef fix: drop nuget bootstrap and popper.js, npm bundles take over
Removing the 'bootstrap' and 'popper.js' NuGet package references
that were used solely to copy assets to wwwroot/ at build time.
The npm-based esbuild bundles now provide the same files, and the
duplicate-asset build error is gone.

'bootstrap 5.3.8' (NuGet) was flagged with vulnerabilities by
Dependabot. Pinning to 4.6.2 via npm (matching what the views
were using from wwwroot/lib/) is closer to what the rest of the
codebase expects.

Verified: 'dotnet test' passes (11/11).

Refs: this is the fix to make the 'separate front assets into
esbuild bundles' commit green.
2026-06-14 14:24:55 +01:00
e98bba4247 refacts and PostIt Nav 2026-06-11 20:02:32 +01:00
1a0556695c Login settings 2026-06-10 16:59:23 +01:00
8dc1680582 no Microsoft.Playwright depedency 2026-06-07 06:52:24 +01:00
963f1327f1 Xamarin.AndroidX.Core.SplashScreen 2026-06-07 06:13:33 +01:00
365a970ae7 CommunityToolkit.Mvvm 2026-06-07 06:10:12 +01:00
77b97aaa5e build w\ Avalonia Android and Browser 2026-06-07 06:06:19 +01:00
1aafb7cc7d IModerationService 2026-05-30 18:20:17 +01:00
71c4f5022c modernization + PostIt 2026-05-29 01:29:36 +01:00
95dec3636a Use InMemory db driver at testing 2026-05-28 22:18:26 +01:00
e1ad899158 Modernization 2026-04-19 17:23:18 +01:00
87d62791b8 fix: test infrastructure with in-memory DB, SMTP mocking, and thread-safe billing configuration
- Add in-memory database support for test isolation in WebServerFixture
- Implement TestMailSender fake SMTP provider for email test support
- Add thread synchronization to billing service registration to prevent race conditions
- Make RegisterBilling<T> idempotent to safely handle reconfiguration
- Configure test environment via in-memory settings (UseTestEmailSender, UseInMemoryDatabase)
- Add regression tests for billing module idempotency and duplicate registration detection
- Fix tests: EMaillingTests.SendEMailSynchrone, BillingServiceTests (2 tests), HaveConfigurationRoot (3 tests)

All core test infrastructure tests now passing.
2026-04-19 14:40:40 +01:00
Paul Schneider
40e8e08690 reorg 2026-02-28 21:17:54 +00:00
Paul Schneider
5cf4bd48e8 refact & cookies 2026-02-17 19:24:30 +00:00
Paul Schneider
ca03b496db cleanup 2026-02-16 00:14:33 +00:00
Paul Schneider
f17202e3bb build 2026-02-14 17:52:01 +00:00
Paul Schneider
a68287d847 Dockerfile & actions 2026-02-02 00:39:24 +00:00
Paul Schneider
e5fa31c9cb using AscDocCsharp, and fixing the tag helper 2025-09-14 17:47:11 +01:00
Paul Schneider
714b2e0efb Passwor re-init 2025-09-07 17:43:13 +01:00
Paul Schneider
03161bbfb6 Id Stores from db 2025-08-24 16:07:53 +01:00
Paul Schneider
0c98ab489d version bumps 2025-07-30 15:51:06 +01:00
Paul Schneider
5c046dfa88 build cli 2025-07-16 00:47:50 +01:00
Paul Schneider
8fc1153e59 testing 2025-07-14 20:35:13 +01:00