Skip to content

Commit

Permalink
Added new categories icons (#2068)
Browse files Browse the repository at this point in the history
* Added new categories icons

* Fixed tests
  • Loading branch information
abalanovsky authored Jul 9, 2024
1 parent e1cecd5 commit de785c1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 51 deletions.
45 changes: 24 additions & 21 deletions src/services/category-icon-service.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
65 changes: 35 additions & 30 deletions tests/unit/services/category-icon-service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit de785c1

Please sign in to comment.