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

fix(react-file-type-icons): return correct icon name for documentsFolder #25688

Merged
merged 2 commits into from
Nov 16, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: return correct icon name for documentsFolder",
"packageName": "@fluentui/react-file-type-icons",
"email": "1330321+yume-chan@users.noreply.github.com",
"dependentChangeType": "patch"
}
15 changes: 15 additions & 0 deletions packages/react-file-type-icons/src/getFileTypeIconProps.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FileIconType } from './FileIconType';
import { FileTypeIconMap } from './FileTypeIconMap';
import { getFileTypeIconNameFromExtensionOrType } from './getFileTypeIconProps';

describe('return valid icon name', () => {
it('returns an icon name in file type icon map', () => {
for (const key of Object.keys(FileIconType)) {
// Iterate through a TypeScript enum
const value = FileIconType[(key as unknown) as FileIconType];
if (typeof value === 'number') {
expect(FileTypeIconMap).toHaveProperty(getFileTypeIconNameFromExtensionOrType(undefined, value));
}
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const MULTIPLE_ITEMS = 'multiple';
const NEWS = 'sponews';
const STREAM = 'video';
const DESKTOP_FOLDER = 'desktopfolder';
const DOCUMENTS_FOLDER = 'documentfolder';
const DOCUMENTS_FOLDER = 'documentsfolder';
const PICTURES_FOLDER = 'picturesfolder';
const LINKED_FOLDER = 'linkedfolder';
const FORM = 'form';
Expand Down