@finsemble/finsemble-ui 6.1.3 → 6.2.0

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.
Files changed (276) hide show
  1. package/package.json +20 -17
  2. package/react/actions/smartDesktopDesignerActions.d.ts +5 -4
  3. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  4. package/react/assets/css/defaultTheme.css +1 -1
  5. package/react/assets/css/notificationsCenter.css +1 -0
  6. package/react/assets/css/userPreferences.css +4 -2
  7. package/react/assets/css/windowTitleBar.css +1 -0
  8. package/react/assets/icons/check-square.svg +6 -0
  9. package/react/assets/icons/lock.svg +6 -0
  10. package/react/components/common/Button.d.ts +1 -0
  11. package/react/components/common/Button.js +2 -2
  12. package/react/components/common/Button.js.map +1 -1
  13. package/react/components/common/ButtonRow.d.ts +15 -0
  14. package/react/components/common/ButtonRow.js +32 -0
  15. package/react/components/common/ButtonRow.js.map +1 -0
  16. package/react/components/common/Checkbox.d.ts +8 -0
  17. package/react/components/common/Checkbox.js +22 -0
  18. package/react/components/common/Checkbox.js.map +1 -0
  19. package/react/components/common/FinsembleIcon.d.ts +1 -1
  20. package/react/components/common/FinsembleIcon.js +4 -0
  21. package/react/components/common/FinsembleIcon.js.map +1 -1
  22. package/react/components/common/FinsembleSelect.d.ts +3 -2
  23. package/react/components/common/FinsembleSelect.js +2 -2
  24. package/react/components/common/FinsembleSelect.js.map +1 -1
  25. package/react/components/common/Tooltip.d.ts +4 -3
  26. package/react/components/common/Tooltip.js +3 -3
  27. package/react/components/common/Tooltip.js.map +1 -1
  28. package/react/components/common/css/tooltip.css +10 -0
  29. package/react/components/common/helpers.js +12 -0
  30. package/react/components/common/helpers.js.map +1 -1
  31. package/react/components/common/stories/ButtonRow.stories.d.ts +14 -0
  32. package/react/components/common/stories/ButtonRow.stories.js +39 -0
  33. package/react/components/common/stories/ButtonRow.stories.js.map +1 -0
  34. package/react/components/common/stories/Checkbox.stories.d.ts +13 -0
  35. package/react/components/common/stories/Checkbox.stories.js +29 -0
  36. package/react/components/common/stories/Checkbox.stories.js.map +1 -0
  37. package/react/components/common/stories/DropdownButton.stories.d.ts +22 -0
  38. package/react/components/common/stories/DropdownButton.stories.js +29 -0
  39. package/react/components/common/stories/DropdownButton.stories.js.map +1 -0
  40. package/react/components/common/stories/FinsembleIcon.stories.js +2 -0
  41. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  42. package/react/components/common/stories/FinsembleSelect.stories.d.ts +1 -1
  43. package/react/components/common/stories/Tooltip.stories.d.ts +1 -1
  44. package/react/components/{shared/addProtocolToValidURL.spec.d.ts → common/tests/ButtonRow.spec.d.ts} +0 -0
  45. package/react/components/common/tests/ButtonRow.spec.js +25 -0
  46. package/react/components/common/tests/ButtonRow.spec.js.map +1 -0
  47. package/react/components/common/tests/Checkbox.spec.d.ts +1 -0
  48. package/react/components/common/tests/Checkbox.spec.js +33 -0
  49. package/react/components/common/tests/Checkbox.spec.js.map +1 -0
  50. package/react/components/fdc3Resolver/ResolverDialog.css +1 -0
  51. package/react/components/fdc3Resolver/ResolverDialog.js +4 -5
  52. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  53. package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -8
  54. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  55. package/react/components/fdc3Resolver/ResolverDialog.stories.js +45 -45
  56. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  57. package/react/components/notifications/components/drawer/DrawerHeader.js +6 -6
  58. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  59. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +32 -31
  60. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  61. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +4 -6
  62. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  63. package/react/components/notifications/components/views/ListView.js +1 -1
  64. package/react/components/notifications/components/views/ListView.js.map +1 -1
  65. package/react/components/notifications/components/views/NotificationDetailsView.js +3 -2
  66. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  67. package/react/components/notifications/constants.d.ts +13 -0
  68. package/react/components/notifications/constants.js.map +1 -1
  69. package/react/components/search/Highlight.js +13 -3
  70. package/react/components/search/Highlight.js.map +1 -1
  71. package/react/components/shared/DefaultDropdownButton.d.ts +1 -0
  72. package/react/components/shared/DefaultDropdownButton.js +14 -4
  73. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  74. package/react/components/shared/tests/DefaultDropdownButton.spec.d.ts +1 -0
  75. package/react/components/shared/tests/DefaultDropdownButton.spec.js +54 -0
  76. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -0
  77. package/react/components/shared/tests/addProtocolToValidURL.spec.d.ts +1 -0
  78. package/react/components/shared/{addProtocolToValidURL.spec.js → tests/addProtocolToValidURL.spec.js} +1 -1
  79. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -0
  80. package/react/components/smartDesktopDesigner/AppEditAccess.d.ts +15 -0
  81. package/react/components/smartDesktopDesigner/AppEditAccess.js +155 -0
  82. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -0
  83. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +7 -1
  84. package/react/components/smartDesktopDesigner/AppEditPage.js +5 -1
  85. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  86. package/react/components/smartDesktopDesigner/Application.d.ts +4 -1
  87. package/react/components/smartDesktopDesigner/Application.js +20 -10
  88. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  89. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +3 -0
  90. package/react/components/smartDesktopDesigner/ApplicationEdit.js +2 -2
  91. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
  92. package/react/components/smartDesktopDesigner/ApplicationList.js +11 -1
  93. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  94. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +6 -1
  95. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
  96. package/react/components/smartDesktopDesigner/Applications.d.ts +2 -0
  97. package/react/components/smartDesktopDesigner/Applications.js +2 -2
  98. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  99. package/react/components/smartDesktopDesigner/common/views.js +2 -0
  100. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  101. package/react/components/smartDesktopDesigner/css/applications.css +38 -0
  102. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +18 -0
  103. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
  104. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +9 -0
  105. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
  106. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +6 -2
  107. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +1 -1
  108. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +71 -2
  109. package/react/components/smartDesktopDesigner/fixtures/apps.js +16 -5
  110. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  111. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +1 -1
  112. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +20 -0
  113. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  114. package/react/components/smartDesktopDesigner/stories/Applications.stories.js +2 -1
  115. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  116. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1 -0
  117. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  118. package/react/components/smartDesktopDesigner/tests/Applications.spec.d.ts +1 -1
  119. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +84 -7
  120. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  121. package/react/components/toolbar/advancedAppLauncher/components/Content.js +2 -3
  122. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  123. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +1 -1
  124. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  125. package/react/components/toolbar/dashbar/Dashbar.js +23 -11
  126. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  127. package/react/components/userPreferences/UserPreferences.js +8 -23
  128. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  129. package/react/components/userPreferences/UserPreferencesBase.d.ts +3 -1
  130. package/react/components/userPreferences/UserPreferencesBase.js +5 -6
  131. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  132. package/react/components/userPreferences/UserPreferencesWrapper.d.ts +4 -0
  133. package/react/components/userPreferences/UserPreferencesWrapper.js +27 -0
  134. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -0
  135. package/react/components/userPreferences/components/ContentSection.d.ts +18 -3
  136. package/react/components/userPreferences/components/ContentSection.js +4 -2
  137. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  138. package/react/components/userPreferences/components/LeftNav.d.ts +19 -4
  139. package/react/components/userPreferences/components/LeftNav.js +11 -10
  140. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  141. package/react/components/userPreferences/components/content/DashbarEditor.d.ts +20 -5
  142. package/react/components/userPreferences/components/content/DashbarEditor.js +11 -11
  143. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  144. package/react/components/userPreferences/components/content/DashbarEditorItem.d.ts +10 -0
  145. package/react/components/userPreferences/components/content/DashbarEditorItem.js +11 -0
  146. package/react/components/userPreferences/components/content/DashbarEditorItem.js.map +1 -0
  147. package/react/components/userPreferences/components/content/General.d.ts +10 -3
  148. package/react/components/userPreferences/components/content/General.js +2 -2
  149. package/react/components/userPreferences/components/content/General.js.map +1 -1
  150. package/react/components/userPreferences/components/content/Workspaces.js +39 -112
  151. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  152. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +9 -11
  153. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  154. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.d.ts +1 -1
  155. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +9 -7
  156. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  157. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.d.ts +3 -1
  158. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +13 -12
  159. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  160. package/react/components/userPreferences/components/general/ScheduledRestart.d.ts +24 -7
  161. package/react/components/userPreferences/components/general/ScheduledRestart.js +71 -22
  162. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  163. package/react/components/userPreferences/components/workspaces/WorkspaceButton.d.ts +9 -0
  164. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +5 -0
  165. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -0
  166. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.d.ts +6 -0
  167. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js +8 -0
  168. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -0
  169. package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +45 -0
  170. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +82 -0
  171. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -0
  172. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.d.ts +8 -0
  173. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js +7 -0
  174. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -0
  175. package/react/components/userPreferences/index.d.ts +1 -1
  176. package/react/components/userPreferences/index.js +1 -1
  177. package/react/components/userPreferences/index.js.map +1 -1
  178. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +0 -1
  179. package/react/components/userPreferences/stores/UserPreferencesStore.js +4 -9
  180. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  181. package/react/components/userPreferences/stories/DashbarEditor.stories.d.ts +2 -1
  182. package/react/components/userPreferences/stories/DashbarEditor.stories.js +35 -4
  183. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  184. package/react/components/userPreferences/stories/DashbarEditorItem.stories.d.ts +11 -0
  185. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js +21 -0
  186. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -0
  187. package/react/components/userPreferences/stories/General.stories.d.ts +9 -0
  188. package/react/components/userPreferences/stories/General.stories.js +16 -0
  189. package/react/components/userPreferences/stories/General.stories.js.map +1 -0
  190. package/react/components/userPreferences/stories/Notifications.stories.d.ts +9 -0
  191. package/react/components/userPreferences/stories/Notifications.stories.js +17 -0
  192. package/react/components/userPreferences/stories/Notifications.stories.js.map +1 -0
  193. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.d.ts +9 -0
  194. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js +20 -0
  195. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -0
  196. package/react/components/userPreferences/stories/NotificationsSources.stories.d.ts +12 -0
  197. package/react/components/userPreferences/stories/NotificationsSources.stories.js +28 -0
  198. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -0
  199. package/react/components/userPreferences/stories/UserPreferences.stories.d.ts +8 -0
  200. package/react/components/userPreferences/stories/UserPreferences.stories.js +53 -0
  201. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -0
  202. package/react/components/userPreferences/stories/WorkspaceButton.stories.d.ts +15 -0
  203. package/react/components/userPreferences/stories/WorkspaceButton.stories.js +13 -0
  204. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -0
  205. package/react/components/userPreferences/stories/WorkspaceComponents.stories.d.ts +13 -0
  206. package/react/components/userPreferences/stories/WorkspaceComponents.stories.js +26 -0
  207. package/react/components/userPreferences/stories/WorkspaceComponents.stories.js.map +1 -0
  208. package/react/components/userPreferences/stories/WorkspaceItem.stories.d.ts +9 -0
  209. package/react/components/userPreferences/stories/WorkspaceItem.stories.js +30 -0
  210. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -0
  211. package/react/components/userPreferences/stories/WorkspaceItemList.stories.d.ts +10 -0
  212. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js +57 -0
  213. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -0
  214. package/react/components/userPreferences/stories/Workspaces.stories.d.ts +9 -0
  215. package/react/components/userPreferences/stories/Workspaces.stories.js +44 -0
  216. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -0
  217. package/react/components/userPreferences/tests/ContentSection.spec.d.ts +1 -0
  218. package/react/components/userPreferences/tests/ContentSection.spec.js +41 -0
  219. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -0
  220. package/react/components/userPreferences/tests/DashbarEditor.spec.d.ts +1 -0
  221. package/react/components/userPreferences/tests/DashbarEditor.spec.js +37 -0
  222. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -0
  223. package/react/components/userPreferences/tests/DashbarEditorItem.spec.d.ts +1 -0
  224. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js +38 -0
  225. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -0
  226. package/react/components/userPreferences/tests/General.spec.d.ts +1 -0
  227. package/react/components/userPreferences/tests/General.spec.js +28 -0
  228. package/react/components/userPreferences/tests/General.spec.js.map +1 -0
  229. package/react/components/userPreferences/tests/LeftNav.spec.d.ts +1 -0
  230. package/react/components/userPreferences/tests/LeftNav.spec.js +12 -0
  231. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -0
  232. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.d.ts +1 -0
  233. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js +14 -0
  234. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -0
  235. package/react/components/userPreferences/tests/Notifications.spec.d.ts +1 -0
  236. package/react/components/userPreferences/tests/Notifications.spec.js +17 -0
  237. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -0
  238. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.d.ts +1 -0
  239. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +39 -0
  240. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -0
  241. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.d.ts +1 -0
  242. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js +22 -0
  243. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -0
  244. package/react/components/userPreferences/tests/ScheduledRestart.spec.d.ts +1 -0
  245. package/react/components/userPreferences/tests/ScheduledRestart.spec.js +70 -0
  246. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -0
  247. package/react/components/userPreferences/tests/WorkspaceButton.spec.d.ts +1 -0
  248. package/react/components/userPreferences/tests/WorkspaceButton.spec.js +24 -0
  249. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -0
  250. package/react/components/userPreferences/tests/WorkspaceComponents.spec.d.ts +1 -0
  251. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js +22 -0
  252. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -0
  253. package/react/components/userPreferences/tests/WorkspaceItem.spec.d.ts +1 -0
  254. package/react/components/userPreferences/tests/WorkspaceItem.spec.js +64 -0
  255. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -0
  256. package/react/components/userPreferences/tests/WorkspaceItemList.spec.d.ts +1 -0
  257. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js +45 -0
  258. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -0
  259. package/react/hooks/useNotifications.d.ts +4 -0
  260. package/react/hooks/useNotifications.js +47 -40
  261. package/react/hooks/useNotifications.js.map +1 -1
  262. package/react/hooks/usePubSub.js.map +1 -1
  263. package/react/hooks/useToolbar.js +71 -48
  264. package/react/hooks/useToolbar.js.map +1 -1
  265. package/react/reducers/rootReducer.d.ts +2 -2
  266. package/react/store.d.ts +4 -4
  267. package/react/types/dashbarTypes.d.ts +1 -1
  268. package/react/types/dashbarTypes.js.map +1 -1
  269. package/react/types/fdc3.d.ts +8 -22
  270. package/react/types/fdc3.js.map +1 -1
  271. package/react/types/smartDesktopDesignerTypes.d.ts +4 -1
  272. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  273. package/react/components/shared/addProtocolToValidURL.spec.js.map +0 -1
  274. package/react/components/userPreferences/components/Checkbox.d.ts +0 -4
  275. package/react/components/userPreferences/components/Checkbox.js +0 -27
  276. package/react/components/userPreferences/components/Checkbox.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ import * as React from "react";
2
+ import { mount } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import ContentSection from "./../components/ContentSection";
6
+ import General from "./../components/content/General";
7
+ import DashbarEditor from "../components/content/DashbarEditor";
8
+ import Notifications from "../components/content/Notifications";
9
+ describe("<ContentSection/>", () => {
10
+ it("should display the correct title for the given activeSection", () => {
11
+ const wrapper = mount(React.createElement(ContentSection, { getValue: () => { }, setValue: () => { }, removeListener: () => { }, addListener: () => { }, activeSection: "Notifications", sections: {
12
+ Dashbar: function dashbarFunc() {
13
+ return React.createElement(DashbarEditor, null);
14
+ },
15
+ General: function generalFunc() {
16
+ return React.createElement(General, { addListener: () => { }, removeListener: () => { }, getValue: () => { } });
17
+ },
18
+ Notifications: function notificationsFunc() {
19
+ return React.createElement(Notifications, null);
20
+ },
21
+ Workspaces: () => { },
22
+ } }));
23
+ expect(wrapper.find("div.leftSide").text()).to.equal("Notifications");
24
+ });
25
+ it("should display the correct component for the given activeSection", () => {
26
+ const wrapper = mount(React.createElement(ContentSection, { getValue: () => { }, setValue: () => { }, removeListener: () => { }, addListener: () => { }, activeSection: "Dashbar", sections: {
27
+ Dashbar: function dashbarFunc() {
28
+ return React.createElement(DashbarEditor, null);
29
+ },
30
+ General: function generalFunc() {
31
+ return React.createElement(General, { addListener: () => { }, removeListener: () => { }, getValue: () => { } });
32
+ },
33
+ Notifications: function notificationsFunc() {
34
+ return React.createElement(Notifications, null);
35
+ },
36
+ Workspaces: () => { },
37
+ } }));
38
+ expect(wrapper.find("#no-dashbar-items")).to.have.lengthOf(1);
39
+ });
40
+ });
41
+ //# sourceMappingURL=ContentSection.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentSection.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/ContentSection.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAsB,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACtD,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAChE,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAEhE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACvE,MAAM,OAAO,GAAG,KAAK,CACpB,oBAAC,cAAc,IACd,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC,EACxB,WAA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E,GAAE,CAAC,GAAI,CAAC;gBACzF,CAAC;gBACD,aAAa,EAAE,SAAS,iBAAiB;oBACxC,OAAO,oBAAC,aAAa,OAAG,CAAC;gBAC1B,CAAC;gBACD,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;aACpB,GACA,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport ContentSection from \"./../components/ContentSection\";\r\nimport General from \"./../components/content/General\";\r\nimport DashbarEditor from \"../components/content/DashbarEditor\";\r\nimport Notifications from \"../components/content/Notifications\";\r\n\r\ndescribe(\"<ContentSection/>\", () => {\r\n\tit(\"should display the correct title for the given activeSection\", () => {\r\n\t\tconst wrapper = mount(\r\n\t\t\t<ContentSection\r\n\t\t\t\tgetValue={() => {}}\r\n\t\t\t\tsetValue={() => {}}\r\n\t\t\t\tremoveListener={() => {}}\r\n\t\t\t\taddListener={() => {}}\r\n\t\t\t\tactiveSection=\"Notifications\"\r\n\t\t\t\tsections={{\r\n\t\t\t\t\tDashbar: function dashbarFunc() {\r\n\t\t\t\t\t\treturn <DashbarEditor />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tGeneral: function generalFunc() {\r\n\t\t\t\t\t\treturn <General addListener={() => {}} removeListener={() => {}} getValue={() => {}} />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tNotifications: function notificationsFunc() {\r\n\t\t\t\t\t\treturn <Notifications />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tWorkspaces: () => {},\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"div.leftSide\").text()).to.equal(\"Notifications\");\r\n\t});\r\n\tit(\"should display the correct component for the given activeSection\", () => {\r\n\t\tconst wrapper = mount(\r\n\t\t\t<ContentSection\r\n\t\t\t\tgetValue={() => {}}\r\n\t\t\t\tsetValue={() => {}}\r\n\t\t\t\tremoveListener={() => {}}\r\n\t\t\t\taddListener={() => {}}\r\n\t\t\t\tactiveSection=\"Dashbar\"\r\n\t\t\t\tsections={{\r\n\t\t\t\t\tDashbar: function dashbarFunc() {\r\n\t\t\t\t\t\treturn <DashbarEditor />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tGeneral: function generalFunc() {\r\n\t\t\t\t\t\treturn <General addListener={() => {}} removeListener={() => {}} getValue={() => {}} />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tNotifications: function notificationsFunc() {\r\n\t\t\t\t\t\treturn <Notifications />;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tWorkspaces: () => {},\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"#no-dashbar-items\")).to.have.lengthOf(1);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import { mount, shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import DashbarEditor from "./../components/content/DashbarEditor";
6
+ import DashbarEditorItem from "./../components/content/DashbarEditorItem";
7
+ describe("<DashbarEditor/>", () => {
8
+ it("should display a message that there are no Dashbar items when there are no Dasbhar items", () => {
9
+ const wrapper = mount(React.createElement(DashbarEditor, null));
10
+ expect(wrapper.find("#no-dashbar-items")).to.have.lengthOf(1);
11
+ });
12
+ it("should not display a message that there are no Dashbar items when there are Dasbhar items", () => {
13
+ const wrapper = mount(React.createElement(DashbarEditor, { availableItems: [
14
+ {
15
+ id: 1,
16
+ enabled: true,
17
+ title: "EURUSD",
18
+ url: "https://dashbar.finsemble.com/index.html?symbol=EURUSD",
19
+ width: 350,
20
+ },
21
+ ] }));
22
+ expect(wrapper.find("#no-dashbar-items")).to.have.lengthOf(0);
23
+ });
24
+ it("should render DashbarEditorItem if there are Dashbar items", () => {
25
+ const wrapper = shallow(React.createElement(DashbarEditor, { availableItems: [
26
+ {
27
+ id: 1,
28
+ enabled: true,
29
+ title: "EURUSD",
30
+ url: "https://dashbar.finsemble.com/index.html?symbol=EURUSD",
31
+ width: 350,
32
+ },
33
+ ] }));
34
+ expect(wrapper.find(DashbarEditorItem).dive().find("#EURUSD-toggle")).to.have.lengthOf(1);
35
+ });
36
+ });
37
+ //# sourceMappingURL=DashbarEditor.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashbarEditor.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/DashbarEditor.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAa,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAE1E,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,0FAA0F,EAAE,GAAG,EAAE;QACnG,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,aAAa,OAAG,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,2FAA2F,EAAE,GAAG,EAAE;QACpG,MAAM,OAAO,GAAG,KAAK,CACpB,oBAAC,aAAa,IACb,cAAc,EAAE;gBACf;oBACC,EAAE,EAAE,CAAC;oBACL,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,QAAQ;oBACf,GAAG,EAAE,wDAAwD;oBAC7D,KAAK,EAAE,GAAG;iBACV;aACD,GACA,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACrE,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,aAAa,IACb,cAAc,EAAE;gBACf;oBACC,EAAE,EAAE,CAAC;oBACL,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,QAAQ;oBACf,GAAG,EAAE,wDAAwD;oBAC7D,KAAK,EAAE,GAAG;iBACV;aACD,GACA,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport DashbarEditor from \"./../components/content/DashbarEditor\";\r\nimport DashbarEditorItem from \"./../components/content/DashbarEditorItem\";\r\n\r\ndescribe(\"<DashbarEditor/>\", () => {\r\n\tit(\"should display a message that there are no Dashbar items when there are no Dasbhar items\", () => {\r\n\t\tconst wrapper = mount(<DashbarEditor />);\r\n\t\texpect(wrapper.find(\"#no-dashbar-items\")).to.have.lengthOf(1);\r\n\t});\r\n\tit(\"should not display a message that there are no Dashbar items when there are Dasbhar items\", () => {\r\n\t\tconst wrapper = mount(\r\n\t\t\t<DashbarEditor\r\n\t\t\t\tavailableItems={[\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 1,\r\n\t\t\t\t\t\tenabled: true,\r\n\t\t\t\t\t\ttitle: \"EURUSD\",\r\n\t\t\t\t\t\turl: \"https://dashbar.finsemble.com/index.html?symbol=EURUSD\",\r\n\t\t\t\t\t\twidth: 350,\r\n\t\t\t\t\t},\r\n\t\t\t\t]}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"#no-dashbar-items\")).to.have.lengthOf(0);\r\n\t});\r\n\tit(\"should render DashbarEditorItem if there are Dashbar items\", () => {\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<DashbarEditor\r\n\t\t\t\tavailableItems={[\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 1,\r\n\t\t\t\t\t\tenabled: true,\r\n\t\t\t\t\t\ttitle: \"EURUSD\",\r\n\t\t\t\t\t\turl: \"https://dashbar.finsemble.com/index.html?symbol=EURUSD\",\r\n\t\t\t\t\t\twidth: 350,\r\n\t\t\t\t\t},\r\n\t\t\t\t]}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(DashbarEditorItem).dive().find(\"#EURUSD-toggle\")).to.have.lengthOf(1);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import DashbarEditorItem from "./../components/content/DashbarEditorItem";
6
+ import { FinsembleToggle } from "./../../common/FinsembleToggle";
7
+ describe("<DashbarEditorItem/>", () => {
8
+ it("should display FinsembleToggle with correct props passed", () => {
9
+ const testFunction = () => {
10
+ console.log("testing");
11
+ };
12
+ const wrapper = shallow(React.createElement(DashbarEditorItem, { id: "1", index: 1, title: "Hello", enabled: true, url: "https://cosaic.io", width: 350, buttonAction: testFunction }));
13
+ expect(wrapper.find(FinsembleToggle).props().checked).to.equal(true);
14
+ expect(wrapper.find(FinsembleToggle).props().onChange).to.equal(testFunction);
15
+ });
16
+ it("should display the correct title passed", () => {
17
+ const testFunction = () => {
18
+ console.log("testing");
19
+ };
20
+ const wrapper = shallow(React.createElement(DashbarEditorItem, { id: "1", index: 1, title: "Hello", enabled: true, url: "https://cosaic.io", width: 350, buttonAction: testFunction }));
21
+ expect(wrapper.find("td").at(1).text()).to.equal("Hello");
22
+ });
23
+ it("should display the correct URL passed", () => {
24
+ const testFunction = () => {
25
+ console.log("testing");
26
+ };
27
+ const wrapper = shallow(React.createElement(DashbarEditorItem, { id: "1", index: 1, title: "Hello", enabled: true, url: "https://cosaic.io", width: 350, buttonAction: testFunction }));
28
+ expect(wrapper.find("td").at(2).text()).to.equal("https://cosaic.io");
29
+ });
30
+ it("should display the correct width passed", () => {
31
+ const testFunction = () => {
32
+ console.log("testing");
33
+ };
34
+ const wrapper = shallow(React.createElement(DashbarEditorItem, { id: "1", index: 1, title: "Hello", enabled: true, url: "https://cosaic.io", width: 350, buttonAction: testFunction }));
35
+ expect(wrapper.find("td").at(3).text()).to.equal("350");
36
+ });
37
+ });
38
+ //# sourceMappingURL=DashbarEditorItem.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashbarEditorItem.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/DashbarEditorItem.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QACnE,MAAM,YAAY,GAAG,GAAG,EA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AG,EAAE;YACzB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,iBAAiB,IACjB,EAAE,EAAE,GAAG,EACP,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,IAAI,EACb,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,GAAG,EACV,YAAY,EAAE,YAAY,GACzB,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAClD,MAAM,YAAY,GAAG,GAAG,EAAE;YACzB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,iBAAiB,IACjB,EAAE,EAAE,GAAG,EACP,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,IAAI,EACb,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,GAAG,EACV,YAAY,EAAE,YAAY,GACzB,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport DashbarEditorItem from \"./../components/content/DashbarEditorItem\";\r\nimport { FinsembleToggle } from \"./../../common/FinsembleToggle\";\r\n\r\ndescribe(\"<DashbarEditorItem/>\", () => {\r\n\tit(\"should display FinsembleToggle with correct props passed\", () => {\r\n\t\tconst testFunction = () => {\r\n\t\t\tconsole.log(\"testing\");\r\n\t\t};\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<DashbarEditorItem\r\n\t\t\t\tid={\"1\"}\r\n\t\t\t\tindex={1}\r\n\t\t\t\ttitle={\"Hello\"}\r\n\t\t\t\tenabled={true}\r\n\t\t\t\turl={\"https://cosaic.io\"}\r\n\t\t\t\twidth={350}\r\n\t\t\t\tbuttonAction={testFunction}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(FinsembleToggle).props().checked).to.equal(true);\r\n\t\texpect(wrapper.find(FinsembleToggle).props().onChange).to.equal(testFunction);\r\n\t});\r\n\tit(\"should display the correct title passed\", () => {\r\n\t\tconst testFunction = () => {\r\n\t\t\tconsole.log(\"testing\");\r\n\t\t};\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<DashbarEditorItem\r\n\t\t\t\tid={\"1\"}\r\n\t\t\t\tindex={1}\r\n\t\t\t\ttitle={\"Hello\"}\r\n\t\t\t\tenabled={true}\r\n\t\t\t\turl={\"https://cosaic.io\"}\r\n\t\t\t\twidth={350}\r\n\t\t\t\tbuttonAction={testFunction}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"td\").at(1).text()).to.equal(\"Hello\");\r\n\t});\r\n\tit(\"should display the correct URL passed\", () => {\r\n\t\tconst testFunction = () => {\r\n\t\t\tconsole.log(\"testing\");\r\n\t\t};\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<DashbarEditorItem\r\n\t\t\t\tid={\"1\"}\r\n\t\t\t\tindex={1}\r\n\t\t\t\ttitle={\"Hello\"}\r\n\t\t\t\tenabled={true}\r\n\t\t\t\turl={\"https://cosaic.io\"}\r\n\t\t\t\twidth={350}\r\n\t\t\t\tbuttonAction={testFunction}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"td\").at(2).text()).to.equal(\"https://cosaic.io\");\r\n\t});\r\n\tit(\"should display the correct width passed\", () => {\r\n\t\tconst testFunction = () => {\r\n\t\t\tconsole.log(\"testing\");\r\n\t\t};\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<DashbarEditorItem\r\n\t\t\t\tid={\"1\"}\r\n\t\t\t\tindex={1}\r\n\t\t\t\ttitle={\"Hello\"}\r\n\t\t\t\tenabled={true}\r\n\t\t\t\turl={\"https://cosaic.io\"}\r\n\t\t\t\twidth={350}\r\n\t\t\t\tbuttonAction={testFunction}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"td\").at(3).text()).to.equal(\"350\");\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import General from "./../components/content/General";
6
+ import ScheduledRestart from "../components/general/ScheduledRestart";
7
+ describe("<General/>", () => {
8
+ it("should render the ScheduledRestart component", () => {
9
+ const wrapper = shallow(React.createElement(General, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
10
+ expect(wrapper.find(ScheduledRestart)).to.have.lengthOf(1);
11
+ });
12
+ it("should pass the correct props to the ScheduledRestart component", () => {
13
+ const func1 = () => {
14
+ console.log("FINSEMBLE");
15
+ };
16
+ const func2 = () => {
17
+ console.log("CHARTIQ");
18
+ };
19
+ const func3 = () => {
20
+ console.log("COSAIC");
21
+ };
22
+ const wrapper = shallow(React.createElement(General, { addListener: func1, removeListener: func2, getValue: func3 }));
23
+ expect(wrapper.find(ScheduledRestart).props().addListener).to.equal(func1);
24
+ expect(wrapper.find(ScheduledRestart).props().removeListener).to.equal(func2);
25
+ expect(wrapper.find(ScheduledRestart).props().getValue).to.equal(func3);
26
+ });
27
+ });
28
+ //# sourceMappingURL=General.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAI,CAAC,CAAC;QACjG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport General from \"./../components/content/General\";\r\nimport ScheduledRestart from \"../components/general/ScheduledRestart\";\r\n\r\ndescribe(\"<General/>\", () => {\r\n\tit(\"should render the ScheduledRestart component\", () => {\r\n\t\tconst wrapper = shallow(<General addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\texpect(wrapper.find(ScheduledRestart)).to.have.lengthOf(1);\r\n\t});\r\n\tit(\"should pass the correct props to the ScheduledRestart component\", () => {\r\n\t\tconst func1 = () => {\r\n\t\t\tconsole.log(\"FINSEMBLE\");\r\n\t\t};\r\n\t\tconst func2 = () => {\r\n\t\t\tconsole.log(\"CHARTIQ\");\r\n\t\t};\r\n\t\tconst func3 = () => {\r\n\t\t\tconsole.log(\"COSAIC\");\r\n\t\t};\r\n\t\tconst wrapper = shallow(<General addListener={func1} removeListener={func2} getValue={func3} />);\r\n\t\texpect(wrapper.find(ScheduledRestart).props().addListener).to.equal(func1);\r\n\t\texpect(wrapper.find(ScheduledRestart).props().removeListener).to.equal(func2);\r\n\t\texpect(wrapper.find(ScheduledRestart).props().getValue).to.equal(func3);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import LeftNav from "../components/LeftNav";
6
+ describe("<LeftNav/>", () => {
7
+ it("should render the same number of ButtonRows as entries", () => {
8
+ const wrapper = shallow(React.createElement(LeftNav, { activeSection: "General", entries: ["General", "Workspaces", "Dashbar", "Notifications"], getValue: () => { }, setValue: () => { }, setActiveEntry: () => { } }));
9
+ expect(wrapper.find("ButtonRow")).to.have.lengthOf(4);
10
+ });
11
+ });
12
+ //# sourceMappingURL=LeftNav.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeftNav.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/LeftNav.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAoB,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QACjE,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,OAAO,IACP,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,CAAC,EAC9D,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC,GACvB,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React, { useState } from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport LeftNav from \"../components/LeftNav\";\r\n\r\ndescribe(\"<LeftNav/>\", () => {\r\n\tit(\"should render the same number of ButtonRows as entries\", () => {\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<LeftNav\r\n\t\t\t\tactiveSection={\"General\"}\r\n\t\t\t\tentries={[\"General\", \"Workspaces\", \"Dashbar\", \"Notifications\"]}\r\n\t\t\t\tgetValue={() => {}}\r\n\t\t\t\tsetValue={() => {}}\r\n\t\t\t\tsetActiveEntry={() => {}}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"ButtonRow\")).to.have.lengthOf(4);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import NotificationSourceTypes from "./../components/content/notificationViews/NotificationsSourceTypes";
6
+ import { initFSBL } from "../../common/helpers";
7
+ describe("<NotificationSourceTypes/>", () => {
8
+ initFSBL(window);
9
+ it("should show the No Source Types Configured message if there are no source types", () => {
10
+ const wrapper = shallow(React.createElement(NotificationSourceTypes, { context: { source: "Finsemble", icon: "" } }));
11
+ expect(wrapper.find("#no-source-types")).to.have.lengthOf(1);
12
+ });
13
+ });
14
+ //# sourceMappingURL=NotificationSourceTypes.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationSourceTypes.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/NotificationSourceTypes.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,uBAAuB,MAAM,oEAAoE,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,EAAE,CAAC,iFAAiF,EAAE,GAAG,EAAE;QAC1F,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAC,uBAAuB,IAAC,OAAO,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,GAAI,CAAC,CAAC;QACjG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport NotificationSourceTypes from \"./../components/content/notificationViews/NotificationsSourceTypes\";\r\nimport { initFSBL } from \"../../common/helpers\";\r\n\r\ndescribe(\"<NotificationSourceTypes/>\", () => {\r\n\tinitFSBL(window);\r\n\tit(\"should show the No Source Types Configured message if there are no source types\", () => {\r\n\t\tconst wrapper = shallow(<NotificationSourceTypes context={{ source: \"Finsemble\", icon: \"\" }} />);\r\n\t\texpect(wrapper.find(\"#no-source-types\")).to.have.lengthOf(1);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import Notifications from "./../components/content/Notifications";
6
+ import NotificationsPreferencesHome from "../components/content/notificationViews/NotificationsPreferencesHome";
7
+ import NotificationsSourcesPreferences from "../components/content/notificationViews/NotificationsSourcesPreferences";
8
+ import NotificationsSourceTypes from "../components/content/notificationViews/NotificationsSourceTypes";
9
+ describe("<Notifications/>", () => {
10
+ it("should render only NotificationsPreferencesHome by default", () => {
11
+ const wrapper = shallow(React.createElement(Notifications, null));
12
+ expect(wrapper.containsMatchingElement(React.createElement(NotificationsPreferencesHome, null))).to.be.true;
13
+ expect(wrapper.containsMatchingElement(React.createElement(NotificationsSourcesPreferences, null))).to.be.false;
14
+ expect(wrapper.containsMatchingElement(React.createElement(NotificationsSourceTypes, null))).to.be.false;
15
+ });
16
+ });
17
+ //# sourceMappingURL=Notifications.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notifications.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/Notifications.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAElE,OAAO,4BAA4B,MAAM,sEAAsE,CAAC;AAChH,OAAO,+BAA+B,MAAM,yEAAyE,CAAC;AACtH,OAAO,wBAAwB,MAAM,kEAAkE,CAAC;AAExG,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACrE,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAC,aAAa,OAAG,CAAC,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACrF,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,oBAAC,+BAA+B,OAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACzF,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,oBAAC,wBAAwB,OAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IACnF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport Notifications from \"./../components/content/Notifications\";\r\nimport { initFSBL } from \"../../common/helpers\";\r\nimport NotificationsPreferencesHome from \"../components/content/notificationViews/NotificationsPreferencesHome\";\r\nimport NotificationsSourcesPreferences from \"../components/content/notificationViews/NotificationsSourcesPreferences\";\r\nimport NotificationsSourceTypes from \"../components/content/notificationViews/NotificationsSourceTypes\";\r\n\r\ndescribe(\"<Notifications/>\", () => {\r\n\tit(\"should render only NotificationsPreferencesHome by default\", () => {\r\n\t\tconst wrapper = shallow(<Notifications />);\r\n\t\texpect(wrapper.containsMatchingElement(<NotificationsPreferencesHome />)).to.be.true;\r\n\t\texpect(wrapper.containsMatchingElement(<NotificationsSourcesPreferences />)).to.be.false;\r\n\t\texpect(wrapper.containsMatchingElement(<NotificationsSourceTypes />)).to.be.false;\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import { mount } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import NotificationsPreferencesHome from "./../components/content/notificationViews/NotificationsPreferencesHome";
6
+ import { initFSBL } from "../../common/helpers";
7
+ describe("<NotificationPreferencesHome/>", () => {
8
+ initFSBL(window);
9
+ beforeEach(() => {
10
+ const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
11
+ if (!wrapper.find("Checkbox").at(0).props().checked) {
12
+ wrapper.find("Checkbox").at(0).simulate("click");
13
+ }
14
+ if (wrapper.find("Checkbox").at(1).props().checked) {
15
+ wrapper.find("Checkbox").at(1).simulate("click");
16
+ }
17
+ if (wrapper.find("Checkbox").at(2).props().checked) {
18
+ wrapper.find("Checkbox").at(1).simulate("click");
19
+ }
20
+ });
21
+ it("should render 1 ButtonRow for Notification Sources", () => {
22
+ const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
23
+ expect(wrapper.find("ButtonRow")).to.have.lengthOf(1);
24
+ });
25
+ it("should render 3 Checkboxes", () => {
26
+ const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
27
+ expect(wrapper.find("Checkbox")).to.have.lengthOf(3);
28
+ });
29
+ it("should render 3 DefualtDropdownButtons", () => {
30
+ const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
31
+ expect(wrapper.find("DefaultDropdownButton")).to.have.lengthOf(3);
32
+ });
33
+ it("should disable the second Checkbox if the first one is unchecked", () => {
34
+ const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
35
+ wrapper.find("Checkbox").at(0).simulate("click");
36
+ expect(wrapper.find("Checkbox").at(1).props().disabled).to.be.true;
37
+ });
38
+ });
39
+ //# sourceMappingURL=NotificationsPreferencesHome.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationsPreferencesHome.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/NotificationsPreferencesHome.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAsB,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,4BAA4B,MAAM,wEAAwE,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QA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oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACpE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport NotificationsPreferencesHome from \"./../components/content/notificationViews/NotificationsPreferencesHome\";\r\nimport { initFSBL } from \"../../common/helpers\";\r\n\r\ndescribe(\"<NotificationPreferencesHome/>\", () => {\r\n\tinitFSBL(window);\r\n\tbeforeEach(() => {\r\n\t\t// Ensures Checkboxes are resetted to default check status\r\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\r\n\t\tif (!wrapper.find(\"Checkbox\").at(0).props().checked) {\r\n\t\t\twrapper.find(\"Checkbox\").at(0).simulate(\"click\");\r\n\t\t}\r\n\t\tif (wrapper.find(\"Checkbox\").at(1).props().checked) {\r\n\t\t\twrapper.find(\"Checkbox\").at(1).simulate(\"click\");\r\n\t\t}\r\n\t\tif (wrapper.find(\"Checkbox\").at(2).props().checked) {\r\n\t\t\twrapper.find(\"Checkbox\").at(1).simulate(\"click\");\r\n\t\t}\r\n\t});\r\n\tit(\"should render 1 ButtonRow for Notification Sources\", () => {\r\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\r\n\t\texpect(wrapper.find(\"ButtonRow\")).to.have.lengthOf(1);\r\n\t});\r\n\r\n\tit(\"should render 3 Checkboxes\", () => {\r\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\r\n\t\texpect(wrapper.find(\"Checkbox\")).to.have.lengthOf(3);\r\n\t});\r\n\r\n\tit(\"should render 3 DefualtDropdownButtons\", () => {\r\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\r\n\t\texpect(wrapper.find(\"DefaultDropdownButton\")).to.have.lengthOf(3);\r\n\t});\r\n\r\n\tit(\"should disable the second Checkbox if the first one is unchecked\", () => {\r\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\r\n\t\twrapper.find(\"Checkbox\").at(0).simulate(\"click\");\r\n\t\texpect(wrapper.find(\"Checkbox\").at(1).props().disabled).to.be.true;\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import NotificationsSourcesPreferences from "./../components/content/notificationViews/NotificationsSourcesPreferences";
6
+ import { initFSBL } from "../../common/helpers";
7
+ describe("<NotificationsSourcesPreferences/>", () => {
8
+ initFSBL(window);
9
+ it("should show the No Notification Sources message if there are no Notification Sources", () => {
10
+ const wrapper = shallow(React.createElement(NotificationsSourcesPreferences, null));
11
+ expect(wrapper.find("#no-notification-sources")).to.have.lengthOf(1);
12
+ });
13
+ it("should not show the No Notification Sources message if there are Notification Sources", () => {
14
+ const wrapper = shallow(React.createElement(NotificationsSourcesPreferences, { context: [{ source: "Cosaic", icon: false, types: [{ name: "default", muted: false }] }] }));
15
+ expect(wrapper.find("#no-notification-sources")).to.have.lengthOf(0);
16
+ });
17
+ it("should render NotificiationSourceRowButton if there are Notification Sources", () => {
18
+ const wrapper = shallow(React.createElement(NotificationsSourcesPreferences, { context: [{ source: "Cosaic", icon: false, types: [{ name: "default", muted: false }] }] }));
19
+ expect(wrapper.find("NotificationSourceRowButton")).to.have.lengthOf(1);
20
+ });
21
+ });
22
+ //# sourceMappingURL=NotificationsSourcesPreferences.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationsSourcesPreferences.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/NotificationsSourcesPreferences.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,+BAA+B,MAAM,2EAA2E,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IACnD,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC/F,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAC,+BAA+B,OAAG,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,uFAAuF,EAAE,GAAG,EAAE;QAChG,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,+BAA+B,IAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,GACvF,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8EAA8E,EAAE,GAAG,EAAE;QACvF,MAAM,OAAO,GAAG,OAAO,CACtB,oBAAC,+BAA+B,IAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,GACvF,CACF,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport NotificationsSourcesPreferences from \"./../components/content/notificationViews/NotificationsSourcesPreferences\";\r\nimport { initFSBL } from \"../../common/helpers\";\r\n\r\ndescribe(\"<NotificationsSourcesPreferences/>\", () => {\r\n\tinitFSBL(window);\r\n\tit(\"should show the No Notification Sources message if there are no Notification Sources\", () => {\r\n\t\tconst wrapper = shallow(<NotificationsSourcesPreferences />);\r\n\t\texpect(wrapper.find(\"#no-notification-sources\")).to.have.lengthOf(1);\r\n\t});\r\n\tit(\"should not show the No Notification Sources message if there are Notification Sources\", () => {\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<NotificationsSourcesPreferences\r\n\t\t\t\tcontext={[{ source: \"Cosaic\", icon: false, types: [{ name: \"default\", muted: false }] }]}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"#no-notification-sources\")).to.have.lengthOf(0);\r\n\t});\r\n\tit(\"should render NotificiationSourceRowButton if there are Notification Sources\", () => {\r\n\t\tconst wrapper = shallow(\r\n\t\t\t<NotificationsSourcesPreferences\r\n\t\t\t\tcontext={[{ source: \"Cosaic\", icon: false, types: [{ name: \"default\", muted: false }] }]}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\"NotificationSourceRowButton\")).to.have.lengthOf(1);\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,70 @@
1
+ import * as React from "react";
2
+ import { mount, shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import ScheduledRestart from "../components/general/ScheduledRestart";
6
+ import { Checkbox } from "../../common/Checkbox";
7
+ import DefaultDropdownButton from "../../shared/DefaultDropdownButton";
8
+ import { initFSBL } from "../../common/helpers";
9
+ import sinon from "sinon";
10
+ describe("<ScheduledRestart/>", () => {
11
+ afterEach(() => {
12
+ sinon.restore();
13
+ });
14
+ it("should disable all the dropdowns if Scheduled Restart is off", () => {
15
+ initFSBL(window);
16
+ const wrapper = shallow(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
17
+ expect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.false;
18
+ expect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.false;
19
+ expect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.false;
20
+ });
21
+ it("should enable all the dropdowns if Scheduled Restart is on", () => {
22
+ initFSBL(window);
23
+ const wrapper = shallow(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
24
+ wrapper.find(Checkbox).simulate("click");
25
+ expect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.true;
26
+ expect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.true;
27
+ expect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.true;
28
+ });
29
+ it("should disable all the dropdowns if Scheduled Restart is on and turned off", () => {
30
+ initFSBL(window);
31
+ const wrapper = shallow(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
32
+ wrapper.find(Checkbox).simulate("click");
33
+ wrapper.find(Checkbox).simulate("click");
34
+ expect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.false;
35
+ expect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.false;
36
+ expect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.false;
37
+ });
38
+ it("should change the scheduled restart hour correctly", () => {
39
+ initFSBL(window);
40
+ const wrapper = mount(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
41
+ wrapper.find(Checkbox).simulate("click");
42
+ wrapper.find(".finsemble-dropdown__btn").at(0).simulate("click");
43
+ wrapper.find(".finsemble-dropdown__btn-option").at(1).simulate("click");
44
+ const timeAfterChange = wrapper.state("scheduledRestart");
45
+ expect(timeAfterChange.hour).to.equal(2);
46
+ });
47
+ it("should change the scheduled restart minute correctly", () => {
48
+ initFSBL(window);
49
+ const wrapper = mount(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
50
+ wrapper.find(Checkbox).simulate("click");
51
+ wrapper.find(".finsemble-dropdown__btn").at(1).simulate("click");
52
+ wrapper.find(".finsemble-dropdown__btn-option").at(1).simulate("click");
53
+ const timeAfterChange = wrapper.state("scheduledRestart");
54
+ expect(timeAfterChange.minute).to.equal(15);
55
+ });
56
+ it("should change the scheduled restart meridiem correctly and getDisplayHour should work", () => {
57
+ initFSBL(window);
58
+ const wrapper = mount(React.createElement(ScheduledRestart, { addListener: () => { }, removeListener: () => { }, getValue: () => { } }));
59
+ wrapper.find(Checkbox).simulate("click");
60
+ wrapper.find(".finsemble-dropdown__btn").at(0).simulate("click");
61
+ wrapper.find(".finsemble-dropdown__btn-option").at(3).simulate("click");
62
+ wrapper.find(".finsemble-dropdown__btn").at(2).simulate("click");
63
+ wrapper.find(".finsemble-dropdown__btn-option").at(1).simulate("click");
64
+ const timeAfterChange = wrapper.state("scheduledRestart");
65
+ expect(timeAfterChange.meridiem).to.equal("PM");
66
+ expect(timeAfterChange.hour).to.equal(16);
67
+ expect(wrapper.find(".finsemble-dropdown__btn-label").at(0).text()).to.equal("4");
68
+ });
69
+ });
70
+ //# sourceMappingURL=ScheduledRestart.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScheduledRestart.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/ScheduledRestart.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAa,OAAO,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAA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E,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxE,MAAM,eAAe,GAAQ,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC/D,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, configure, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport ScheduledRestart from \"../components/general/ScheduledRestart\";\r\nimport { Checkbox } from \"../../common/Checkbox\";\r\nimport DefaultDropdownButton from \"../../shared/DefaultDropdownButton\";\r\nimport { initFSBL } from \"../../common/helpers\";\r\nimport { waitTime } from \"../../smartDesktopDesigner/sdd_helpers\";\r\nimport sinon from \"sinon\";\r\n\r\ndescribe(\"<ScheduledRestart/>\", () => {\r\n\tafterEach(() => {\r\n\t\tsinon.restore();\r\n\t});\r\n\r\n\tit(\"should disable all the dropdowns if Scheduled Restart is off\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = shallow(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.false;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.false;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.false;\r\n\t});\r\n\r\n\tit(\"should enable all the dropdowns if Scheduled Restart is on\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = shallow(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.true;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.true;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.true;\r\n\t});\r\n\r\n\tit(\"should disable all the dropdowns if Scheduled Restart is on and turned off\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = shallow(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(0).props().enabled).to.be.false;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(1).props().enabled).to.be.false;\r\n\t\texpect(wrapper.find(DefaultDropdownButton).at(2).props().enabled).to.be.false;\r\n\t});\r\n\r\n\tit(\"should change the scheduled restart hour correctly\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = mount(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn\").at(0).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(1).simulate(\"click\");\r\n\t\tconst timeAfterChange: any = wrapper.state(\"scheduledRestart\");\r\n\t\texpect(timeAfterChange.hour).to.equal(2);\r\n\t});\r\n\r\n\tit(\"should change the scheduled restart minute correctly\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = mount(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn\").at(1).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(1).simulate(\"click\");\r\n\t\tconst timeAfterChange: any = wrapper.state(\"scheduledRestart\");\r\n\t\texpect(timeAfterChange.minute).to.equal(15);\r\n\t});\r\n\r\n\tit(\"should change the scheduled restart meridiem correctly and getDisplayHour should work\", () => {\r\n\t\tinitFSBL(window);\r\n\t\tconst wrapper = mount(<ScheduledRestart addListener={() => {}} removeListener={() => {}} getValue={() => {}} />);\r\n\t\twrapper.find(Checkbox).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn\").at(0).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(3).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn\").at(2).simulate(\"click\");\r\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(1).simulate(\"click\");\r\n\t\tconst timeAfterChange: any = wrapper.state(\"scheduledRestart\");\r\n\t\texpect(timeAfterChange.meridiem).to.equal(\"PM\");\r\n\t\texpect(timeAfterChange.hour).to.equal(16);\r\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-label\").at(0).text()).to.equal(\"4\");\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { mount } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import sinon from "sinon";
6
+ import addons, { mockChannel } from "@storybook/addons";
7
+ import { WorkspaceButton } from "../components/workspaces/WorkspaceButton";
8
+ addons.setChannel(mockChannel());
9
+ describe("<WorkspaceButton/>", () => {
10
+ afterEach(() => {
11
+ sinon.restore();
12
+ });
13
+ it("should show the correct icon and label for import", async () => {
14
+ const wrapper = mount(React.createElement(WorkspaceButton, { type: "import" }));
15
+ expect(wrapper.find(".ff-import")).to.be.length(1);
16
+ expect(wrapper.find(".workspace-action-button-label").text()).to.equal("Import");
17
+ });
18
+ it("should show the correct icon and label for export", async () => {
19
+ const wrapper = mount(React.createElement(WorkspaceButton, { type: "export" }));
20
+ expect(wrapper.find(".ff-export")).to.be.length(1);
21
+ expect(wrapper.find(".workspace-action-button-label").text()).to.equal("Export");
22
+ });
23
+ });
24
+ //# sourceMappingURL=WorkspaceButton.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceButton.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/WorkspaceButton.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAW,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,eAAe,IAAC,IAAI,EAAC,QAAQ,GAAG,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,eAAe,IAAC,IAAI,EAAC,QAAQ,GAAG,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount, shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport sinon from \"sinon\";\r\nimport addons, { mockChannel } from \"@storybook/addons\";\r\nimport { waitTime } from \"../../smartDesktopDesigner/sdd_helpers\";\r\nimport { WorkspaceButton } from \"../components/workspaces/WorkspaceButton\";\r\n\r\naddons.setChannel(mockChannel());\r\n\r\ndescribe(\"<WorkspaceButton/>\", () => {\r\n\tafterEach(() => {\r\n\t\tsinon.restore();\r\n\t});\r\n\r\n\tit(\"should show the correct icon and label for import\", async () => {\r\n\t\tconst wrapper = mount(<WorkspaceButton type=\"import\" />);\r\n\t\texpect(wrapper.find(\".ff-import\")).to.be.length(1);\r\n\t\texpect(wrapper.find(\".workspace-action-button-label\").text()).to.equal(\"Import\");\r\n\t});\r\n\r\n\tit(\"should show the correct icon and label for export\", async () => {\r\n\t\tconst wrapper = mount(<WorkspaceButton type=\"export\" />);\r\n\t\texpect(wrapper.find(\".ff-export\")).to.be.length(1);\r\n\t\texpect(wrapper.find(\".workspace-action-button-label\").text()).to.equal(\"Export\");\r\n\t});\r\n});\r\n"]}
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { shallow } from "enzyme";
3
+ import { describe, it } from "mocha";
4
+ import { expect } from "chai";
5
+ import sinon from "sinon";
6
+ import addons, { mockChannel } from "@storybook/addons";
7
+ import WorkspaceComponents from "../components/workspaces/WorkspaceComponents";
8
+ addons.setChannel(mockChannel());
9
+ describe("<WorkspaceComponents/>", () => {
10
+ afterEach(() => {
11
+ sinon.restore();
12
+ });
13
+ it("should render a list of workspace-components", async () => {
14
+ const wrapper = shallow(React.createElement(WorkspaceComponents, { focusedWorkspaceComponentList: ["component1", "components2"] }));
15
+ expect(wrapper.find(".workspace-component")).to.be.length(2);
16
+ });
17
+ it('should render "No Components." if the component list is empty', async () => {
18
+ const wrapper = shallow(React.createElement(WorkspaceComponents, { focusedWorkspaceComponentList: [] }));
19
+ expect(wrapper.find(".no-components")).to.be.length(1);
20
+ });
21
+ });
22
+ //# sourceMappingURL=WorkspaceComponents.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceComponents.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/WorkspaceComponents.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,mBAAmB,MAAM,8CAA8C,CAAC;AAE/E,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAC,mBAAmB,IAAC,6BAA6B,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,GAAI,CAAC,CAAC;QAC/G,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAC,mBAAmB,IAAC,6BAA6B,EAAE,EAAE,GAAI,CAAC,CAAC;QACpF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { shallow } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport sinon from \"sinon\";\r\nimport addons, { mockChannel } from \"@storybook/addons\";\r\nimport { waitTime } from \"../../smartDesktopDesigner/sdd_helpers\";\r\nimport WorkspaceComponents from \"../components/workspaces/WorkspaceComponents\";\r\n\r\naddons.setChannel(mockChannel());\r\n\r\ndescribe(\"<WorkspaceComponents/>\", () => {\r\n\tafterEach(() => {\r\n\t\tsinon.restore();\r\n\t});\r\n\tit(\"should render a list of workspace-components\", async () => {\r\n\t\tconst wrapper = shallow(<WorkspaceComponents focusedWorkspaceComponentList={[\"component1\", \"components2\"]} />);\r\n\t\texpect(wrapper.find(\".workspace-component\")).to.be.length(2);\r\n\t});\r\n\r\n\tit('should render \"No Components.\" if the component list is empty', async () => {\r\n\t\tconst wrapper = shallow(<WorkspaceComponents focusedWorkspaceComponentList={[]} />);\r\n\t\texpect(wrapper.find(\".no-components\")).to.be.length(1);\r\n\t});\r\n});\r\n"]}