@gisce/react-ooui 1.1.28 → 1.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +1 -7
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +1 -1
- package/dist/react-ooui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/iconMapper.test.ts +11 -0
- package/src/helpers/iconMapper.ts +1 -2
package/package.json
CHANGED
|
@@ -16,4 +16,15 @@ describe("A IconMapper instance", () => {
|
|
|
16
16
|
const icon = iconMapper("gtk-find-and-replace");
|
|
17
17
|
expect(icon).toBe(findAndReplaceIcon);
|
|
18
18
|
})
|
|
19
|
+
test("should return gtk-go", () => {
|
|
20
|
+
const findAndReplaceIcon = Icons.FileSearchOutlined;
|
|
21
|
+
const icon = iconMapper("gtk-find-and-replace");
|
|
22
|
+
expect(icon).toBe(findAndReplaceIcon);
|
|
23
|
+
})
|
|
24
|
+
describe("If key doesn't exist in iconMapper", () => {
|
|
25
|
+
test("should return undefined", () => {
|
|
26
|
+
const icon = iconMapper("gtk-foo-bar");
|
|
27
|
+
expect(icon).toBe(undefined);
|
|
28
|
+
})
|
|
29
|
+
})
|
|
19
30
|
});
|
|
@@ -103,8 +103,7 @@ const iconMapping: { [key: string]: string } = {
|
|
|
103
103
|
export default (key: string) => {
|
|
104
104
|
if (key.indexOf("gtk-") !== -1) {
|
|
105
105
|
const rootIcon = key.replace("gtk-", "").replace(/\-/g, "_");
|
|
106
|
-
|
|
107
|
-
return getIconForKey(iconMapping[newKey]);
|
|
106
|
+
key = `STOCK_${rootIcon.toUpperCase()}`;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
if (iconMapping.hasOwnProperty(key)) {
|