Skip to content

Commit

Permalink
apply further linting
Browse files Browse the repository at this point in the history
  • Loading branch information
naomatheus committed Sep 6, 2023
1 parent 6dcd48a commit 1e34db2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions src/utils/__tests__/use-platform-list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/utils/rename-category-test-util.js
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 1e34db2

Please sign in to comment.