From 6d9efa4ce97825b3a68ab1cb02f50fb5ff747bcd Mon Sep 17 00:00:00 2001 From: abalanovsky Date: Mon, 8 Jul 2024 18:49:47 +0300 Subject: [PATCH 1/2] Added new categories icons --- src/services/category-icon-service.ts | 45 ++++++++++++++------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/services/category-icon-service.ts b/src/services/category-icon-service.ts index 1f4077be8..6e746c7ca 100644 --- a/src/services/category-icon-service.ts +++ b/src/services/category-icon-service.ts @@ -1,30 +1,33 @@ -import AccountBalanceIcon from '@mui/icons-material/AccountBalance' -import BiotechIcon from '@mui/icons-material/Biotech' -import ColorLensIcon from '@mui/icons-material/ColorLens' -import DesignServicesIcon from '@mui/icons-material/DesignServices' -import DesktopMacOutlinedIcon from '@mui/icons-material/DesktopMacOutlined' +import TagRoundedIcon from '@mui/icons-material/TagRounded' +import ScienceRoundedIcon from '@mui/icons-material/ScienceRounded' +import CampaignIcon from '@mui/icons-material/Campaign' +import MusicNoteRoundedIcon from '@mui/icons-material/MusicNoteRounded' +import ColorLensRoundedIcon from '@mui/icons-material/ColorLensRounded' +import StackedBarChartIcon from '@mui/icons-material/StackedBarChart' +import LegendToggleRoundedIcon from '@mui/icons-material/LegendToggleRounded' import LanguageIcon from '@mui/icons-material/Language' -import LegendToggleIcon from '@mui/icons-material/LegendToggle' -import MusicNoteIcon from '@mui/icons-material/MusicNote' -import ScienceIcon from '@mui/icons-material/Science' -import StarIcon from '@mui/icons-material/Star' -import TagIcon from '@mui/icons-material/Tag' -import HistoryEduIcon from '@mui/icons-material/HistoryEdu' +import DesignServicesIcon from '@mui/icons-material/DesignServices' +import HistoryEduRoundedIcon from '@mui/icons-material/HistoryEduRounded' +import DesktopMacRoundedIcon from '@mui/icons-material/DesktopMacRounded' +import AccountTreeRoundedIcon from '@mui/icons-material/AccountTreeRounded' +import StarRoundedIcon from '@mui/icons-material/StarRounded' + import { SvgIconComponent } from '@mui/icons-material' const CATEGORY_ICONS = { LanguageIcon, - ColorLensIcon, - BiotechIcon, - DesktopMacOutlinedIcon, - TagIcon, - AccountBalanceIcon, - StarIcon, DesignServicesIcon, - MusicNoteIcon, - ScienceIcon, - LegendToggleIcon, - HistoryEduIcon + TagRoundedIcon, + ScienceRoundedIcon, + CampaignIcon, + MusicNoteRoundedIcon, + ColorLensRoundedIcon, + StackedBarChartIcon, + LegendToggleRoundedIcon, + HistoryEduRoundedIcon, + DesktopMacRoundedIcon, + AccountTreeRoundedIcon, + StarRoundedIcon } as const type CategoryIconKey = keyof typeof CATEGORY_ICONS From 58fbdf333d13ef3bf4ed67fe33c89e9cb1e22160 Mon Sep 17 00:00:00 2001 From: abalanovsky Date: Mon, 8 Jul 2024 19:19:05 +0300 Subject: [PATCH 2/2] Fixed tests --- .../services/category-icon-service.spec.js | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/tests/unit/services/category-icon-service.spec.js b/tests/unit/services/category-icon-service.spec.js index 2f598fd1e..eb8b08636 100644 --- a/tests/unit/services/category-icon-service.spec.js +++ b/tests/unit/services/category-icon-service.spec.js @@ -5,63 +5,68 @@ vi.mock('@mui/icons-material/Language', () => ({ default: 'LanguageIcon' })) -vi.mock('@mui/icons-material/ColorLens', () => ({ - default: 'ColorLensIcon' +vi.mock('@mui/icons-material/ColorLensRounded', () => ({ + default: 'ColorLensRoundedIcon' })) -vi.mock('@mui/icons-material/Biotech', () => ({ - default: 'BiotechIcon' +vi.mock('@mui/icons-material/ScienceRounded', () => ({ + default: 'ScienceRoundedIcon' })) -vi.mock('@mui/icons-material/DesktopMacOutlined', () => ({ - default: 'DesktopMacOutlinedIcon' +vi.mock('@mui/icons-material/DesktopMacRounded', () => ({ + default: 'DesktopMacRoundedIcon' })) -vi.mock('@mui/icons-material/Tag', () => ({ - default: 'TagIcon' +vi.mock('@mui/icons-material/TagRounded', () => ({ + default: 'TagRoundedIcon' })) -vi.mock('@mui/icons-material/AccountBalance', () => ({ - default: 'AccountBalanceIcon' +vi.mock('@mui/icons-material/AccountTreeRounded', () => ({ + default: 'AccountTreeRoundedIcon' })) -vi.mock('@mui/icons-material/Star', () => ({ - default: 'StarIcon' +vi.mock('@mui/icons-material/StarRounded', () => ({ + default: 'StarRoundedIcon' })) vi.mock('@mui/icons-material/DesignServices', () => ({ default: 'DesignServicesIcon' })) -vi.mock('@mui/icons-material/MusicNote', () => ({ - default: 'MusicNoteIcon' +vi.mock('@mui/icons-material/MusicNoteRounded', () => ({ + default: 'MusicNoteRoundedIcon' })) -vi.mock('@mui/icons-material/Science', () => ({ - default: 'ScienceIcon' +vi.mock('@mui/icons-material/StackedBarChart', () => ({ + default: 'StackedBarChartIcon' })) -vi.mock('@mui/icons-material/LegendToggle', () => ({ - default: 'LegendToggleIcon' +vi.mock('@mui/icons-material/LegendToggleRounded', () => ({ + default: 'LegendToggleRoundedIcon' })) -vi.mock('@mui/icons-material/HistoryEdu', () => ({ - default: 'HistoryEduIcon' +vi.mock('@mui/icons-material/HistoryEduRounded', () => ({ + default: 'HistoryEduRoundedIcon' +})) + +vi.mock('@mui/icons-material/Campaign', () => ({ + default: 'CampaignIcon' })) const iconNames = [ 'LanguageIcon', - 'ColorLensIcon', - 'BiotechIcon', - 'DesktopMacOutlinedIcon', - 'TagIcon', - 'AccountBalanceIcon', - 'StarIcon', + 'ColorLensRoundedIcon', + 'ScienceRoundedIcon', + 'DesktopMacRoundedIcon', + 'TagRoundedIcon', + 'AccountTreeRoundedIcon', + 'StarRoundedIcon', 'DesignServicesIcon', - 'MusicNoteIcon', - 'ScienceIcon', - 'LegendToggleIcon', - 'HistoryEduIcon' + 'MusicNoteRoundedIcon', + 'StackedBarChartIcon', + 'LegendToggleRoundedIcon', + 'HistoryEduRoundedIcon', + 'CampaignIcon' ] describe('categoryIconService test', () => {