Skip to content

Commit

Permalink
fix(react-file-type-icons): return correct icon name for documentsFol…
Browse files Browse the repository at this point in the history
…der (#25688)

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

* add change file
  • Loading branch information
yume-chan authored Nov 16, 2022
1 parent bd0257f commit 5c824b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
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));
}
}
});
});
2 changes: 1 addition & 1 deletion packages/react-file-type-icons/src/getFileTypeIconProps.ts
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

0 comments on commit 5c824b8

Please sign in to comment.