diff --git a/changes/22469-rpm-support b/changes/22469-rpm-support new file mode 100644 index 000000000000..95929d000816 --- /dev/null +++ b/changes/22469-rpm-support @@ -0,0 +1 @@ +- Ability to add/edit .rpm software packages \ No newline at end of file diff --git a/frontend/pages/SoftwarePage/components/PackageForm/PackageForm.tsx b/frontend/pages/SoftwarePage/components/PackageForm/PackageForm.tsx index 545a5a3881cb..4e9d7aa74de0 100644 --- a/frontend/pages/SoftwarePage/components/PackageForm/PackageForm.tsx +++ b/frontend/pages/SoftwarePage/components/PackageForm/PackageForm.tsx @@ -173,7 +173,7 @@ const PackageForm = ({ canEdit={isEditingSoftware} graphicName={"file-pkg"} accept={ACCEPTED_EXTENSIONS} - message=".pkg, .msi, .exe, .deb or .rpm" + message=".pkg, .msi, .exe, .deb, or .rpm" onFileUpload={onFileSelect} buttonMessage="Choose file" buttonType="link" diff --git a/frontend/utilities/file/fileUtils.tests.ts b/frontend/utilities/file/fileUtils.tests.ts index 8d650638920a..f21f84001959 100644 --- a/frontend/utilities/file/fileUtils.tests.ts +++ b/frontend/utilities/file/fileUtils.tests.ts @@ -2,15 +2,22 @@ import { getPlatformDisplayName } from "./fileUtils"; describe("fileUtils", () => { describe("getPlatformDisplayName", () => { - it("should return the correct platform display name depending on the file extension", () => { - const file = new File([""], "test.pkg"); - expect(getPlatformDisplayName(file)).toEqual("macOS"); + const testCases = [ + { extension: "pkg", platform: "macOS" }, + { extension: "json", platform: "macOS" }, + { extension: "mobileconfig", platform: "macOS" }, + { extension: "exe", platform: "Windows" }, + { extension: "msi", platform: "Windows" }, + { extension: "xml", platform: "Windows" }, + { extension: "deb", platform: "Linux" }, + { extension: "rpm", platform: "Linux" }, + ]; - const file2 = new File([""], "test.exe"); - expect(getPlatformDisplayName(file2)).toEqual("Windows"); - - const file3 = new File([""], "test.deb"); - expect(getPlatformDisplayName(file3)).toEqual("linux"); + testCases.forEach(({ extension, platform }) => { + it(`should return ${platform} for .${extension} files`, () => { + const file = new File([""], `test.${extension}`); + expect(getPlatformDisplayName(file)).toEqual(platform); + }); }); }); });