From 1e34db271ff2c80ad4c667b2477ef1caf23974f9 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Wed, 6 Sep 2023 16:28:15 +0200 Subject: [PATCH] apply further linting --- src/utils/__tests__/use-platform-list.test.js | 15 +++++++++------ src/utils/rename-category-test-util.js | 8 ++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/utils/__tests__/use-platform-list.test.js b/src/utils/__tests__/use-platform-list.test.js index c3be8ce2..ca04fbb1 100644 --- a/src/utils/__tests__/use-platform-list.test.js +++ b/src/utils/__tests__/use-platform-list.test.js @@ -18,10 +18,10 @@ it("the default platform list (without filters)", () => { const platformGroups = Object.keys(platformList.grouped) // console.log({ platformList }) // console.log({ platformGroups }) - const firstGroup = platformList.grouped[platformGroups[platformGroups.length - 1]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] console.log({ firstGroup }) - expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) expect(firstPlatform.campaigns.length).toBeGreaterThan( @@ -52,7 +52,8 @@ it("the platform list sorted a > z (without filters)", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[platformGroups.length - 1]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -84,7 +85,8 @@ it("the platform list sorted z > a (without filters)", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[platformGroups.length - 1]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -119,7 +121,8 @@ it("the platform list with a filter selected", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[platformGroups.length - 1]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toBeLessThan(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -142,7 +145,7 @@ it("the platform list with a filter selected", () => { }) platformGroups.forEach(group => { // Adjusting group name for the changed category name - const adjustedGroupName = getCategoryName(group); + const adjustedGroupName = getCategoryName(group) platformList.grouped[adjustedGroupName].forEach(platform => { expect(platform.instruments.map(x => x.id)).toContain(instrumentId) diff --git a/src/utils/rename-category-test-util.js b/src/utils/rename-category-test-util.js index 0ff26f54..e49fbdc7 100644 --- a/src/utils/rename-category-test-util.js +++ b/src/utils/rename-category-test-util.js @@ -1,4 +1,4 @@ -export const getCategoryName = (category) => { - if (category === "Aircraft") return "Air-based platforms"; - return category; -}; +export const getCategoryName = category => { + if (category === "Aircraft") return "Air-based platforms" + return category +}