Files
ytLlive/ytLive.Tests/AboutHubTests.cs
T
gramps 86fcd868a8 Monetization policy locked + dev pause recorded (docs changeset, 2026-08-14): the one paid line becomes an annual subscription — early access $49.99/yr → $99/yr list at GA, grandfather-while-subscribed with lapse → list on renewal (no escalation matrix); free tier unchanged (branding flash is the free tier's billboard + no Alerts, which is the one paid feature); billing NOT locked to itch.io (hunted fact: itch.io has no native subscription billing — candidates Gumroad, whose native affiliate program is the tiebreaker, and Lemon Squeezy); support = in-app bug-report → git issues with a when-I-get-around-to-it cadence + emergency patches. ai.md Monetization section rewritten + stale paid-unlock seams fixed (L115 subscription-entitlement wording, the About hub's tabled billing PremiumUrl seam); TASKS.md gains TASK 23 (Monetization — billing provider decision, unlock mechanism with lapse→flash-returns enforcement, in-app bug-report loop, Unlock Premium seam lighting, Alerts gating, and line-item pointers for the early-access strategy, affiliate/ads phase 2, and the channel revival); HANDOFF.md records the decisions + the development pause (resume streaming = pair-programming dev streams via OBS + The Division 2 under the gramps/GOAT persona, 67 and gaming since 1981, 3D-printing content retired; dogfood switch to ytLlive once TASK 5 lands; resume point = TASK 5). Stale itch.io assertions corrected across comments and indexes (MainViewModel.cs PremiumUrl/IsPremium seams, MainWindow.xaml tooltip, AboutHubTests comment, ViewModels/index.md, TASK 9 out-of-scope note). Build 0 warnings, 196 tests passing
2026-08-14 18:48:42 -07:00

71 lines
2.6 KiB
C#

using System;
using Microsoft.Data.Sqlite;
using Xunit;
using ytLive.ViewModels;
namespace ytLive.Tests;
/// <summary>
/// The About overlay is the in-app creator hub: it opens from the real window,
/// and its licensing sub-panel surfaces the full THIRD-PARTY-NOTICES.txt
/// in-app (scrolling text, never the OS viewer / Notepad). Drives the real VM
/// through the real window — same real-App + temp-DB pattern as the round-clip
/// and source-naming tests.
/// </summary>
[Collection("RealApp")]
public sealed class AboutHubTests
{
private readonly RealAppHost _app;
public AboutHubTests(RealAppHost app)
{
_app = app;
}
[Fact]
public void About_Opens_InApp_Licensing_Loads_Shipped_Notices()
{
_app.Run(Run);
}
private void Run()
{
var tempDb = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"ytLlive-about-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
var window = new MainWindow();
var vm = (MainViewModel)window.DataContext;
try
{
// About hub opens (the wordmark / gear menu entry point).
vm.OpenAboutCommand.Execute(null);
Assert.True(vm.IsAboutOpen);
Assert.False(vm.IsLicensesOpen);
// The hub links resolve to real destinations (channel + mastodon +
// coffee are live; premium is the tabled billing seam).
Assert.Equal("https://youtube.com/@llamachileshop", MainViewModel.ChannelUrl);
Assert.Equal("https://mastodon.llamachile.tube/@gramps", MainViewModel.MastodonUrl);
Assert.Equal("https://buymeacoffee.com/llamachiley", MainViewModel.CoffeeUrl);
// The licensing panel loads the full shipped notices text in-app.
vm.OpenLicensesCommand.Execute(null);
Assert.True(vm.IsLicensesOpen);
Assert.False(string.IsNullOrWhiteSpace(vm.LicensesText));
Assert.Contains("Third-Party Notices", vm.LicensesText, StringComparison.OrdinalIgnoreCase);
Assert.Contains("LGPL", vm.LicensesText, StringComparison.OrdinalIgnoreCase);
// Back returns to the hub view (code-behind click handler path is
// equivalent; here we assert the VM contract the handler uses).
vm.IsLicensesOpen = false;
Assert.True(vm.IsAboutOpen);
}
finally
{
window.Close();
MainViewModel.LayoutPathOverride = null;
SqliteConnection.ClearAllPools();
try { System.IO.File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}
}
}