Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Filee.Core/Presets/BuiltInData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ public static List<ToolbarProfile> CreateProfiles()
{
"images" => (["to-png", "to-jpg", "to-webp", "to-gif", "to-pdf", "trace-svg"],
["tool-crop", "rotate", "remove-background", "merge-images", "compress-image", "half-size", "tool-image-edit", "zip-all"]),
"pdf" => (["to-png", "to-jpg", "to-docx", "pdf-slides", "to-txt", "to-hwpx", "to-hwp"],
"pdf" => (["to-png", "to-jpg", "to-docx", "to-xlsx", "pdf-slides", "to-txt", "to-hwpx", "to-hwp"],
["pdf-edit", "pdf-split", "merge-pdf", "compress-pdf", "remove-metadata", "to-tiff", "to-html", "zip-all"]),
"office" => (["to-pdf", "to-hwpx", "to-hwp", "to-docx", "to-txt", "to-png", "merge-pdf"],
["translate", "to-md", "pdf-long-image", "zip-all"]),
Expand Down
5 changes: 3 additions & 2 deletions tests/Filee.Core.Tests/BackFaceTests.SlotTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ namespace Filee.Core.Tests;
public partial class BackFaceTests
{
// Slot table of #806, with Translate from #836 first on the document, text and e-book backs, and Crop video (#830)
// after Cut a clip. This is a new-install/reset contract, not migration input.
// after Cut a clip, and XLSX (#1343) after Word on the PDF front. This is a new-install/reset contract, not
// migration input.
internal static readonly Dictionary<string, (string[] Front, string[] Back)> ExpectedFaces = new()
{
["images"] = (["to-png", "to-jpg", "to-webp", "to-gif", "to-pdf", "trace-svg"], ["tool-crop", "rotate", "remove-background", "merge-images", "compress-image", "half-size", "tool-image-edit", "zip-all"]),
["pdf"] = (["to-png", "to-jpg", "to-docx", "pdf-slides", "to-txt", "to-hwpx", "to-hwp"], ["pdf-edit", "pdf-split", "merge-pdf", "compress-pdf", "remove-metadata", "to-tiff", "to-html", "zip-all"]),
["pdf"] = (["to-png", "to-jpg", "to-docx", "to-xlsx", "pdf-slides", "to-txt", "to-hwpx", "to-hwp"], ["pdf-edit", "pdf-split", "merge-pdf", "compress-pdf", "remove-metadata", "to-tiff", "to-html", "zip-all"]),
["office"] = (["to-pdf", "to-hwpx", "to-hwp", "to-docx", "to-txt", "to-png", "merge-pdf"], ["translate", "to-md", "pdf-long-image", "zip-all"]),
["spreadsheets"] = (["to-pdf", "to-xlsx", "to-csv", "to-hwpx", "to-hwp", "merge-pdf"], ["tool-sheet-studio", "to-docx", "to-vcf", "to-ics", "zip-all"]),
["presentations"] = (["to-pdf", "to-png", "to-jpg", "to-pptx", "to-hwpx", "to-hwp", "merge-pdf"], ["to-odp", "pdf-long-image", "to-docx", "zip-all"]),
Expand Down
4 changes: 2 additions & 2 deletions tests/Filee.Core.Tests/BackFaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public void Back_from_Filee_1_0_1_or_1_1_0_a_new_library_gets_its_new_back_faces
// The fronts as read are the new ones, so the new back faces; the migrations before 30 then add front slots, and
// v31, v33 and v37 back slots, as for any library of that schema.
Assert.Equal(schema == 4
? ["to-png", "to-jpg", "pdf-long-image", "to-docx", "pdf-slides", "to-hwp", "to-md", "to-epub"]
: ["to-png", "to-jpg", "pdf-long-image", "to-docx", "pdf-slides", "to-txt", "to-md", "to-epub", "to-hwpx", "to-hwp"],
? ["to-png", "to-jpg", "pdf-long-image", "to-docx", "to-xlsx", "pdf-slides", "to-hwp", "to-md", "to-epub"]
: ["to-png", "to-jpg", "pdf-long-image", "to-docx", "to-xlsx", "pdf-slides", "to-txt", "to-md", "to-epub", "to-hwpx", "to-hwp"],
Profile(back, "pdf").PresetIds);
Assert.Equal(["pdf-edit", "pdf-split", "merge-pdf", "compress-pdf", "remove-metadata", "to-tiff", "to-html", "zip-all"],
Profile(back, "pdf").BackPresetIds);
Expand Down
30 changes: 30 additions & 0 deletions tests/Filee.Core.Tests/PdfXlsxSlotTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// PDF → XLSX (#1343, #1187) works but was on no PDF donut, so people didn't find it. A new library has it on the PDF
// front, after DOCX; an existing library keeps its donuts as they are (#806), and the user adds it from the palette.

using Filee.Core.Presets;
using Filee.Core.Profiles;

namespace Filee.Core.Tests;

public class PdfXlsxSlotTests
{
private static ToolbarProfile Pdf(List<ToolbarProfile> profiles) => profiles.Single(p => p.Id == "pdf");

[Fact]
public void A_new_library_has_XLSX_on_the_PDF_front_after_DOCX()
{
var pdf = Pdf(BuiltInData.CreateProfiles());

Assert.Equal(pdf.PresetIds.IndexOf("to-docx") + 1, pdf.PresetIds.IndexOf("to-xlsx"));
Assert.DoesNotContain("to-xlsx", pdf.BackPresetIds!);
}

[Fact]
public void The_schema_58_PDF_donut_stays_without_it()
{
var pdf = Pdf(BuiltInData.ProfilesSchema58());

Assert.DoesNotContain("to-xlsx", pdf.PresetIds);
Assert.DoesNotContain("to-xlsx", pdf.BackPresetIds!);
}
}
Loading