Brand flash OFF by default: MainViewModel.ShowBrandFlash master switch (default false) gates BrandFlashEnabled; feature kept, tests opt in; new test guards the default (Unit: brand flash off)

This commit is contained in:
2026-10-09 13:22:52 -07:00
parent 352f117cb2
commit 8303b1cf7f
4 changed files with 59 additions and 12 deletions
+34
View File
@@ -164,6 +164,7 @@ public sealed class BrandFlashOutputTests
{
var tempDb = Path.Combine(Path.GetTempPath(), $"ytLlive-test-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
MainViewModel.ShowBrandFlash = true; // the credit is off by default (2026-10-09)
var window = new MainWindow();
var vm = (MainViewModel)window.DataContext;
try
@@ -202,6 +203,7 @@ public sealed class BrandFlashOutputTests
{
window.Close();
MainViewModel.LayoutPathOverride = null;
MainViewModel.ShowBrandFlash = false;
SqliteConnection.ClearAllPools();
try { File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}
@@ -381,6 +383,36 @@ public sealed class BrandFlashOutputTests
Assert.True(prop.CanRead, "the preview needs to read the gate state");
}
/// <summary>Creator ruling 2026-10-09: the credit is OFF by default — a freshly
/// constructed app with no licence still emits nothing to the preview or the output.</summary>
[Fact]
public void Credit_IsOffByDefault_EvenOnTheFreeTier()
{
_app.Run(() =>
{
Assert.False(MainViewModel.ShowBrandFlash);
var tempDb = Path.Combine(Path.GetTempPath(), $"ytLlive-test-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
var window = new MainWindow();
var vm = (MainViewModel)window.DataContext;
try
{
Assert.False(vm.IsPremium);
Assert.False(vm.BrandFlashEnabled);
vm.AdvanceBrandFlash(120); // past several cadence windows
Assert.Null(vm.BrandFlashFrame());
Assert.False(vm.BrandFlashVisible);
}
finally
{
window.Close();
MainViewModel.LayoutPathOverride = null;
SqliteConnection.ClearAllPools();
try { File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}
});
}
// ---------- the credit is NOT a go-live-only behaviour ----------
/// <summary>Reported 2026-09-26: "the made with llamacasty flash should appear in
@@ -400,6 +432,7 @@ public sealed class BrandFlashOutputTests
{
var tempDb = Path.Combine(Path.GetTempPath(), $"ytLlive-test-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
MainViewModel.ShowBrandFlash = true; // the credit is off by default (2026-10-09)
var window = new MainWindow();
var vm = (MainViewModel)window.DataContext;
try
@@ -441,6 +474,7 @@ public sealed class BrandFlashOutputTests
{
window.Close();
MainViewModel.LayoutPathOverride = null;
MainViewModel.ShowBrandFlash = false;
SqliteConnection.ClearAllPools();
try { File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}