@@ -24,12 +24,43 @@ describe("IconUtils", () => {
2424 IconUtils . clearRegistry ( ) ;
2525
2626 // Assert
27- expect ( Object . keys ( IconUtils . getRegistry ) ) . toHaveLength ( 0 ) ;
27+ expect ( IconUtils . getRegistry ( ) ) . toEqual ( { } ) ;
2828 } ) ;
2929 } ) ;
3030
3131 // #endregion clearRegistry
3232
33+ // -----------------------------------------------------------------------------------------
34+ // #region getRegistry
35+ // -----------------------------------------------------------------------------------------
36+
37+ describe ( "getRegistry" , ( ) => {
38+ test ( "given no icons registered, returns empty object" , ( ) => {
39+ // Arrange & Act
40+ const result = IconUtils . getRegistry ( ) ;
41+
42+ // Assert
43+ expect ( result ) . toEqual ( { } ) ;
44+ } ) ;
45+
46+ test ( "given icons registered, returns new instance of registry" , ( ) => {
47+ // Arrange
48+ const ChevronDown = getSvgIconByType ( Icons . ChevronDown ) ;
49+ IconUtils . registerSvgIcon ( ChevronDown ) ;
50+
51+ // Act
52+ const firstResult = IconUtils . getRegistry ( ) ;
53+ const secondResult = IconUtils . getRegistry ( ) ;
54+
55+ // Assert
56+ expect ( firstResult [ ChevronDown . type ] ) . not . toBeUndefined ( ) ;
57+ expect ( secondResult [ ChevronDown . type ] ) . not . toBeUndefined ( ) ;
58+ expect ( firstResult ) . not . toBe ( secondResult ) ;
59+ } ) ;
60+ } ) ;
61+
62+ // #endregion getRegistry
63+
3364 // -----------------------------------------------------------------------------------------
3465 // #region getSvg
3566 // -----------------------------------------------------------------------------------------
@@ -113,37 +144,6 @@ describe("IconUtils", () => {
113144
114145 // #endregion getSvgIcon
115146
116- // -----------------------------------------------------------------------------------------
117- // #region getRegistry
118- // -----------------------------------------------------------------------------------------
119-
120- describe ( "getRegistry" , ( ) => {
121- test ( "given no icons registered, returns empty object" , ( ) => {
122- // Arrange & Act
123- const result = IconUtils . getRegistry ( ) ;
124-
125- // Assert
126- expect ( Object . keys ( result ) ) . toHaveLength ( 0 ) ;
127- } ) ;
128-
129- test ( "given icons registered, returns new instance of registry" , ( ) => {
130- // Arrange
131- const ChevronDown = getSvgIconByType ( Icons . ChevronDown ) ;
132- IconUtils . registerSvgIcon ( ChevronDown ) ;
133-
134- // Act
135- const firstResult = IconUtils . getRegistry ( ) ;
136- const secondResult = IconUtils . getRegistry ( ) ;
137-
138- // Assert
139- expect ( firstResult [ ChevronDown . type ] ) . not . toBeUndefined ( ) ;
140- expect ( secondResult [ ChevronDown . type ] ) . not . toBeUndefined ( ) ;
141- expect ( firstResult ) . not . toBe ( secondResult ) ;
142- } ) ;
143- } ) ;
144-
145- // #endregion getRegistry
146-
147147 // -----------------------------------------------------------------------------------------
148148 // #region register
149149 // -----------------------------------------------------------------------------------------
0 commit comments