From 40c167685036a1b939716ec04a67a404cc61271a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Wed, 13 Nov 2024 13:58:17 +0000 Subject: [PATCH] chore(web): eslint --- .../storage/model/config/space-policy.test.ts | 96 ++++++------------- 1 file changed, 28 insertions(+), 68 deletions(-) diff --git a/web/src/storage/model/config/space-policy.test.ts b/web/src/storage/model/config/space-policy.test.ts index 80a8ad66c3..d8fdd318ce 100644 --- a/web/src/storage/model/config/space-policy.test.ts +++ b/web/src/storage/model/config/space-policy.test.ts @@ -24,24 +24,14 @@ import * as model from "~/storage/model/config/space-policy"; describe("#generate", () => { it("returns 'delete' if there is a file system", () => { - expect( - model.generate({ - filesystem: { type: "xfs" }, - }), - ).toEqual("delete"); + expect(model.generate({ filesystem: { type: "xfs" } })).toEqual("delete"); }); it("returns 'delete' if there is a 'delete all' partition", () => { - expect( - model.generate({ - partitions: [{ search: "*", delete: true }], - }), - ).toEqual("delete"); + expect(model.generate({ partitions: [{ search: "*", delete: true }] })).toEqual("delete"); expect( - model.generate({ - partitions: [{ search: { ifNotFound: "skip" }, delete: true }], - }), + model.generate({ partitions: [{ search: { ifNotFound: "skip" }, delete: true }] }), ).toEqual("delete"); expect( @@ -53,16 +43,12 @@ describe("#generate", () => { it("returns 'resize' if there is a 'shrink all' partition", () => { expect( - model.generate({ - partitions: [{ search: "*", size: { min: 0, max: "current" } }], - }), + model.generate({ partitions: [{ search: "*", size: { min: 0, max: "current" } }] }), ).toEqual("resize"); - expect( - model.generate({ - partitions: [{ search: "*", size: [0, "current"] }], - }), - ).toEqual("resize"); + expect(model.generate({ partitions: [{ search: "*", size: [0, "current"] }] })).toEqual( + "resize", + ); expect( model.generate({ @@ -78,52 +64,34 @@ describe("#generate", () => { }); it("returns 'custom' if there is a 'delete' or 'resize' partition", () => { - expect( - model.generate({ - partitions: [{ search: "/dev/vda", delete: true }], - }), - ).toEqual("custom"); + expect(model.generate({ partitions: [{ search: "/dev/vda", delete: true }] })).toEqual( + "custom", + ); expect( - model.generate({ - partitions: [{ search: { max: 2, ifNotFound: "skip" }, delete: true }], - }), + model.generate({ partitions: [{ search: { max: 2, ifNotFound: "skip" }, delete: true }] }), ).toEqual("custom"); - expect( - model.generate({ - partitions: [{ search: "*", deleteIfNeeded: true }], - }), - ).toEqual("custom"); + expect(model.generate({ partitions: [{ search: "*", deleteIfNeeded: true }] })).toEqual( + "custom", + ); expect( - model.generate({ - partitions: [{ search: "*", deleteIfNeeded: true, size: [0, "current"] }], - }), + model.generate({ partitions: [{ search: "*", deleteIfNeeded: true, size: [0, "current"] }] }), ).toEqual("custom"); - expect( - model.generate({ - partitions: [{ search: "*", size: { min: 0 } }], - }), - ).toEqual("custom"); + expect(model.generate({ partitions: [{ search: "*", size: { min: 0 } }] })).toEqual("custom"); - expect( - model.generate({ - partitions: [{ search: "*", size: { min: 0, max: 1024 } }], - }), - ).toEqual("custom"); + expect(model.generate({ partitions: [{ search: "*", size: { min: 0, max: 1024 } }] })).toEqual( + "custom", + ); - expect( - model.generate({ - partitions: [{ search: "/dev/vda", delete: true }], - }), - ).toEqual("custom"); + expect(model.generate({ partitions: [{ search: "/dev/vda", delete: true }] })).toEqual( + "custom", + ); expect( - model.generate({ - partitions: [{ search: "/dev/vda", size: { min: 0, max: "current" } }], - }), + model.generate({ partitions: [{ search: "/dev/vda", size: { min: 0, max: "current" } }] }), ).toEqual("custom"); expect( @@ -134,24 +102,16 @@ describe("#generate", () => { }); it("returns 'keep' if there is neither 'delete' nor 'resize' partition", () => { - expect( - model.generate({ - partitions: [{ search: "*", filesystem: { type: "xfs" } }], - }), - ).toEqual("keep"); + expect(model.generate({ partitions: [{ search: "*", filesystem: { type: "xfs" } }] })).toEqual( + "keep", + ); expect( - model.generate({ - partitions: [{ generate: "default" }, { filesystem: { path: "/home" } }], - }), + model.generate({ partitions: [{ generate: "default" }, { filesystem: { path: "/home" } }] }), ).toEqual("keep"); }); it("returns 'keep' if there are not partitions", () => { - expect( - model.generate({ - search: "/dev/vda", - }), - ).toEqual("keep"); + expect(model.generate({ search: "/dev/vda" })).toEqual("keep"); }); });