Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new categories icons #2068

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading