feat(11-02): extend export tests to verify branding injection across all 5 services
- HtmlExportServiceTests: 3 new tests (MSP logo only, null branding no img, both logos) - SearchExportServiceTests: 1 new branding test (img tag present when branding provided) - StorageHtmlExportServiceTests: 1 new branding test (img tag present) - DuplicatesHtmlExportServiceTests: 1 new branding test (img tag present) - UserAccessHtmlExportServiceTests: 1 new branding test (img tag present) - MakeBranding helper added to each test class - All 45 export tests pass; full suite 247/247 with 0 failures
This commit is contained in:
@@ -6,6 +6,13 @@ namespace SharepointToolbox.Tests.Services.Export;
|
||||
|
||||
public class DuplicatesHtmlExportServiceTests
|
||||
{
|
||||
private static ReportBranding MakeBranding(bool msp = true, bool client = false)
|
||||
{
|
||||
var mspLogo = msp ? new LogoData { Base64 = "bXNw", MimeType = "image/png" } : null;
|
||||
var clientLogo = client ? new LogoData { Base64 = "Y2xpZW50", MimeType = "image/jpeg" } : null;
|
||||
return new ReportBranding(mspLogo, clientLogo);
|
||||
}
|
||||
|
||||
private static DuplicateGroup MakeGroup(string name, int count) => new()
|
||||
{
|
||||
GroupKey = $"{name}|1024",
|
||||
@@ -50,4 +57,15 @@ public class DuplicatesHtmlExportServiceTests
|
||||
var html = svc.BuildHtml(new List<DuplicateGroup>());
|
||||
Assert.Contains("<!DOCTYPE html>", html);
|
||||
}
|
||||
|
||||
// ── Branding tests ────────────────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void BuildHtml_WithBranding_ContainsLogoImg()
|
||||
{
|
||||
var svc = new DuplicatesHtmlExportService();
|
||||
var groups = new List<DuplicateGroup> { MakeGroup("report.docx", 2) };
|
||||
var html = svc.BuildHtml(groups, MakeBranding(msp: true));
|
||||
Assert.Contains("data:image/png;base64,bXNw", html);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user