@cccsaurora/howler-ui 3.1.0-dev.1656 → 3.1.0-dev.1657
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/api/action/execute.test.d.ts +1 -0
- package/api/action/execute.test.js +38 -0
- package/api/action/index.test.d.ts +1 -0
- package/api/action/index.test.js +59 -0
- package/api/action/operations.test.d.ts +1 -0
- package/api/action/operations.test.js +23 -0
- package/api/analytic/comments/index.test.d.ts +1 -0
- package/api/analytic/comments/index.test.js +43 -0
- package/api/analytic/comments/react.test.d.ts +1 -0
- package/api/analytic/comments/react.test.js +27 -0
- package/api/analytic/favourite.test.d.ts +1 -0
- package/api/analytic/favourite.test.js +20 -0
- package/api/analytic/index.test.d.ts +1 -0
- package/api/analytic/index.test.js +54 -0
- package/api/analytic/notebooks/index.test.d.ts +1 -0
- package/api/analytic/notebooks/index.test.js +31 -0
- package/api/analytic/owner.test.d.ts +1 -0
- package/api/analytic/owner.test.js +25 -0
- package/api/auth/apikey.test.d.ts +1 -0
- package/api/auth/apikey.test.js +34 -0
- package/api/auth/index.test.d.ts +1 -0
- package/api/auth/index.test.js +21 -0
- package/api/auth/login.test.d.ts +1 -0
- package/api/auth/login.test.js +53 -0
- package/api/configs/index.test.d.ts +1 -0
- package/api/configs/index.test.js +22 -0
- package/api/dossier/index.test.d.ts +1 -0
- package/api/dossier/index.test.js +57 -0
- package/api/help.test.d.ts +1 -0
- package/api/help.test.js +25 -0
- package/api/hit/assign.test.d.ts +1 -0
- package/api/hit/assign.test.js +22 -0
- package/api/hit/comments/index.test.d.ts +1 -0
- package/api/hit/comments/index.test.js +47 -0
- package/api/hit/comments/react.test.d.ts +1 -0
- package/api/hit/comments/react.test.js +27 -0
- package/api/hit/index.test.d.ts +1 -0
- package/api/hit/index.test.js +49 -0
- package/api/hit/labels.test.d.ts +1 -0
- package/api/hit/labels.test.js +29 -0
- package/api/hit/overwrite.test.d.ts +1 -0
- package/api/hit/overwrite.test.js +23 -0
- package/api/hit/transition.test.d.ts +1 -0
- package/api/hit/transition.test.js +24 -0
- package/api/index.test.d.ts +1 -0
- package/api/index.test.js +137 -0
- package/api/notebook/environments.test.d.ts +1 -0
- package/api/notebook/environments.test.js +22 -0
- package/api/notebook/index.test.d.ts +1 -0
- package/api/notebook/index.test.js +28 -0
- package/api/overview/index.test.d.ts +1 -0
- package/api/overview/index.test.js +42 -0
- package/api/search/fields/index.test.d.ts +1 -0
- package/api/search/fields/index.test.js +31 -0
- package/api/search/grouped/index.test.d.ts +1 -0
- package/api/search/grouped/index.test.js +18 -0
- package/api/search/grouped/user.test.d.ts +1 -0
- package/api/search/grouped/user.test.js +33 -0
- package/api/search/index.test.d.ts +1 -0
- package/api/search/index.test.js +41 -0
- package/api/search/user.test.d.ts +1 -0
- package/api/search/user.test.js +41 -0
- package/api/socket/index.test.d.ts +1 -0
- package/api/socket/index.test.js +15 -0
- package/api/template/index.test.d.ts +1 -0
- package/api/template/index.test.js +43 -0
- package/api/user/avatar/index.test.d.ts +1 -0
- package/api/user/avatar/index.test.js +22 -0
- package/api/user/groups.test.d.ts +1 -0
- package/api/user/groups.test.js +22 -0
- package/api/user/index.test.d.ts +1 -0
- package/api/user/index.test.js +37 -0
- package/api/user/whoami.test.d.ts +1 -0
- package/api/user/whoami.test.js +26 -0
- package/api/utils/createPermissionsApi.test.d.ts +1 -0
- package/api/utils/createPermissionsApi.test.js +30 -0
- package/api/v2/case/index.test.d.ts +1 -0
- package/api/v2/case/index.test.js +57 -0
- package/api/v2/case/items.test.d.ts +1 -0
- package/api/v2/case/items.test.js +37 -0
- package/api/v2/case/rules.test.d.ts +1 -0
- package/api/v2/case/rules.test.js +33 -0
- package/api/v2/fuzzy.test.d.ts +1 -0
- package/api/v2/fuzzy.test.js +30 -0
- package/api/v2/index.test.d.ts +1 -0
- package/api/v2/index.test.js +13 -0
- package/api/v2/search/index.test.d.ts +1 -0
- package/api/v2/search/index.test.js +42 -0
- package/api/view/index.test.d.ts +1 -0
- package/api/view/index.test.js +54 -0
- package/branding/AppBrand.test.d.ts +1 -0
- package/branding/AppBrand.test.js +29 -0
- package/components/app/drawers/ApiKeyDrawer.test.d.ts +1 -0
- package/components/app/drawers/ApiKeyDrawer.test.js +119 -0
- package/components/app/drawers/AssignUserDrawer.test.d.ts +1 -0
- package/components/app/drawers/AssignUserDrawer.test.js +75 -0
- package/components/app/hooks/useTitle.test.d.ts +1 -0
- package/components/app/hooks/useTitle.test.js +103 -0
- package/components/app/providers/AnalyticProvider.test.d.ts +1 -0
- package/components/app/providers/AnalyticProvider.test.js +58 -0
- package/components/app/providers/AppBarProvider.test.d.ts +1 -0
- package/components/app/providers/AppBarProvider.test.js +23 -0
- package/components/app/providers/AppDrawerProvider.test.d.ts +1 -0
- package/components/app/providers/AppDrawerProvider.test.js +42 -0
- package/components/app/providers/AvatarProvider.test.d.ts +1 -0
- package/components/app/providers/AvatarProvider.test.js +50 -0
- package/components/app/providers/CustomPluginProvider.test.d.ts +1 -0
- package/components/app/providers/CustomPluginProvider.test.js +29 -0
- package/components/app/providers/FavouritesProvider.test.d.ts +1 -0
- package/components/app/providers/FavouritesProvider.test.js +115 -0
- package/components/app/providers/FieldProvider.test.d.ts +1 -0
- package/components/app/providers/FieldProvider.test.js +28 -0
- package/components/app/providers/LocalStorageProvider.test.d.ts +1 -0
- package/components/app/providers/LocalStorageProvider.test.js +42 -0
- package/components/app/providers/ModalProvider.test.d.ts +1 -0
- package/components/app/providers/ModalProvider.test.js +35 -0
- package/components/app/providers/OverviewProvider.test.d.ts +1 -0
- package/components/app/providers/OverviewProvider.test.js +62 -0
- package/components/app/providers/RecordProvider.test.d.ts +1 -0
- package/components/app/providers/RecordProvider.test.js +66 -0
- package/components/app/providers/contextUtils.test.d.ts +1 -0
- package/components/app/providers/contextUtils.test.js +8 -0
- package/components/elements/Comment.test.d.ts +1 -0
- package/components/elements/Comment.test.js +109 -0
- package/components/elements/EditRow.test.d.ts +1 -0
- package/components/elements/EditRow.test.js +88 -0
- package/components/elements/MarkdownEditor.test.d.ts +1 -0
- package/components/elements/MarkdownEditor.test.js +75 -0
- package/components/elements/ObjectDetails.test.d.ts +1 -0
- package/components/elements/ObjectDetails.test.js +70 -0
- package/components/elements/PluginChip.d.ts +3 -2
- package/components/elements/PluginChip.js +2 -2
- package/components/elements/PluginChip.test.d.ts +1 -0
- package/components/elements/PluginChip.test.js +30 -0
- package/components/elements/ThemedEditor.test.d.ts +1 -0
- package/components/elements/ThemedEditor.test.js +66 -0
- package/components/elements/addons/layout/FlexPort.test.d.ts +1 -0
- package/components/elements/addons/layout/FlexPort.test.js +34 -0
- package/components/elements/addons/lists/TuiListBase.test.d.ts +1 -0
- package/components/elements/addons/lists/TuiListBase.test.js +44 -0
- package/components/elements/addons/lists/TuiListProvider.test.d.ts +1 -0
- package/components/elements/addons/lists/TuiListProvider.test.js +50 -0
- package/components/elements/addons/search/phrase/Phrase.test.d.ts +1 -0
- package/components/elements/addons/search/phrase/Phrase.test.js +77 -0
- package/components/elements/addons/search/phrase/PhraseLexer.test.d.ts +1 -0
- package/components/elements/addons/search/phrase/PhraseLexer.test.js +92 -0
- package/components/elements/addons/search/phrase/index.test.d.ts +1 -0
- package/components/elements/addons/search/phrase/index.test.js +20 -0
- package/components/elements/case/CaseCard.test.d.ts +1 -0
- package/components/elements/case/CaseCard.test.js +107 -0
- package/components/elements/display/ClassificationChip.test.d.ts +1 -0
- package/components/elements/display/ClassificationChip.test.js +60 -0
- package/components/elements/display/HandlebarsMarkdown.test.d.ts +1 -0
- package/components/elements/display/HandlebarsMarkdown.test.js +41 -0
- package/components/elements/display/HowlerAvatar.test.d.ts +1 -0
- package/components/elements/display/HowlerAvatar.test.js +54 -0
- package/components/elements/display/ItemManager.test.d.ts +1 -0
- package/components/elements/display/ItemManager.test.js +68 -0
- package/components/elements/display/UserPageWrapper.test.d.ts +1 -0
- package/components/elements/display/UserPageWrapper.test.js +22 -0
- package/components/elements/display/handlebars/helpers.test.d.ts +1 -0
- package/components/elements/display/handlebars/helpers.test.js +104 -0
- package/components/elements/display/icons/SocketBadge.test.d.ts +1 -0
- package/components/elements/display/icons/SocketBadge.test.js +49 -0
- package/components/elements/display/markdownPlugins/tabs.test.d.ts +1 -0
- package/components/elements/display/markdownPlugins/tabs.test.js +50 -0
- package/components/elements/hit/HitActions.js +1 -1
- package/components/elements/hit/HitActions.test.d.ts +1 -0
- package/components/elements/hit/HitActions.test.js +166 -0
- package/components/elements/hit/HitLabels.test.js +34 -3
- package/components/elements/hit/HitNotebooks.test.d.ts +1 -0
- package/components/elements/hit/HitNotebooks.test.js +138 -0
- package/components/elements/hit/HitSummary.test.d.ts +1 -0
- package/components/elements/hit/HitSummary.test.js +188 -0
- package/components/elements/hit/actions/ButtonActions.test.d.ts +1 -0
- package/components/elements/hit/actions/ButtonActions.test.js +51 -0
- package/components/elements/hit/actions/DropdownActions.test.d.ts +1 -0
- package/components/elements/hit/actions/DropdownActions.test.js +60 -0
- package/components/elements/hit/grid/AddColumnModal.test.d.ts +1 -0
- package/components/elements/hit/grid/AddColumnModal.test.js +88 -0
- package/components/elements/hit/grid/RecordTable.test.d.ts +1 -0
- package/components/elements/hit/grid/RecordTable.test.js +99 -0
- package/components/elements/record/RecordComments.test.d.ts +1 -0
- package/components/elements/record/RecordComments.test.js +151 -0
- package/components/elements/record/RecordRelated.test.d.ts +1 -0
- package/components/elements/record/RecordRelated.test.js +77 -0
- package/components/elements/record/RecordWorklog.test.d.ts +1 -0
- package/components/elements/record/RecordWorklog.test.js +77 -0
- package/components/hooks/useHitActions.test.d.ts +1 -0
- package/components/hooks/useHitActions.test.js +189 -0
- package/components/hooks/useMyApi.test.d.ts +1 -0
- package/components/hooks/useMyApi.test.js +31 -0
- package/components/hooks/useMyChart.test.d.ts +1 -0
- package/components/hooks/useMyChart.test.js +62 -0
- package/components/hooks/useMySearch.test.d.ts +1 -0
- package/components/hooks/useMySearch.test.js +96 -0
- package/components/hooks/useMySnackbar.test.d.ts +1 -0
- package/components/hooks/useMySnackbar.test.js +36 -0
- package/components/hooks/useMyUserFunctions.test.d.ts +1 -0
- package/components/hooks/useMyUserFunctions.test.js +142 -0
- package/components/hooks/useRecordSelection.test.d.ts +1 -0
- package/components/hooks/useRecordSelection.test.js +102 -0
- package/components/logins/Login.test.d.ts +1 -0
- package/components/logins/Login.test.js +67 -0
- package/components/logins/hooks/useLogin.test.d.ts +1 -0
- package/components/logins/hooks/useLogin.test.js +142 -0
- package/components/routes/action/shared/OperationEntry.test.d.ts +1 -0
- package/components/routes/action/shared/OperationEntry.test.js +80 -0
- package/components/routes/action/shared/OperationStep.test.d.ts +1 -0
- package/components/routes/action/shared/OperationStep.test.js +84 -0
- package/components/routes/action/useMyActionFunctions.test.d.ts +1 -0
- package/components/routes/action/useMyActionFunctions.test.js +217 -0
- package/components/routes/action/view/ActionDetails.test.d.ts +1 -0
- package/components/routes/action/view/ActionDetails.test.js +170 -0
- package/components/routes/action/view/ActionSearch.test.d.ts +1 -0
- package/components/routes/action/view/ActionSearch.test.js +185 -0
- package/components/routes/action/view/Integrations.test.d.ts +1 -0
- package/components/routes/action/view/Integrations.test.js +62 -0
- package/components/routes/admin/users/UserEditor.test.d.ts +1 -0
- package/components/routes/admin/users/UserEditor.test.js +74 -0
- package/components/routes/admin/users/UserSearch.test.d.ts +1 -0
- package/components/routes/admin/users/UserSearch.test.js +146 -0
- package/components/routes/advanced/QueryBuilder.test.d.ts +1 -0
- package/components/routes/advanced/QueryBuilder.test.js +185 -0
- package/components/routes/advanced/QueryEditor.test.d.ts +1 -0
- package/components/routes/advanced/QueryEditor.test.js +130 -0
- package/components/routes/advanced/completionProviders.test.d.ts +1 -0
- package/components/routes/advanced/completionProviders.test.js +144 -0
- package/components/routes/analytics/AnalyticComments.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticComments.test.js +156 -0
- package/components/routes/analytics/AnalyticDetails.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticDetails.test.js +161 -0
- package/components/routes/analytics/AnalyticNotebooks.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticNotebooks.test.js +112 -0
- package/components/routes/analytics/AnalyticOverview.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticOverview.test.js +97 -0
- package/components/routes/analytics/AnalyticOverviews.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticOverviews.test.js +70 -0
- package/components/routes/analytics/AnalyticSearch.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticSearch.test.js +167 -0
- package/components/routes/analytics/AnalyticTemplates.test.d.ts +1 -0
- package/components/routes/analytics/AnalyticTemplates.test.js +63 -0
- package/components/routes/analytics/TriageSettings.test.d.ts +1 -0
- package/components/routes/analytics/TriageSettings.test.js +89 -0
- package/components/routes/analytics/widgets/Assessment.test.d.ts +1 -0
- package/components/routes/analytics/widgets/Assessment.test.js +45 -0
- package/components/routes/analytics/widgets/Created.test.d.ts +1 -0
- package/components/routes/analytics/widgets/Created.test.js +41 -0
- package/components/routes/analytics/widgets/DetectionStatus.test.d.ts +1 -0
- package/components/routes/analytics/widgets/DetectionStatus.test.js +21 -0
- package/components/routes/analytics/widgets/Stacked.test.d.ts +1 -0
- package/components/routes/analytics/widgets/Stacked.test.js +51 -0
- package/components/routes/cases/Cases.test.d.ts +1 -0
- package/components/routes/cases/Cases.test.js +132 -0
- package/components/routes/dossiers/Dossiers.test.d.ts +1 -0
- package/components/routes/dossiers/Dossiers.test.js +150 -0
- package/components/routes/help/ActionDocumentation.test.d.ts +1 -0
- package/components/routes/help/ActionDocumentation.test.js +58 -0
- package/components/routes/help/ActionIntroductionDocumentation.test.d.ts +1 -0
- package/components/routes/help/ActionIntroductionDocumentation.test.js +68 -0
- package/components/routes/help/ApiDocumentation.test.d.ts +1 -0
- package/components/routes/help/ApiDocumentation.test.js +79 -0
- package/components/routes/help/AuthDocumentation.test.d.ts +1 -0
- package/components/routes/help/AuthDocumentation.test.js +34 -0
- package/components/routes/help/ClientDocumentation.test.d.ts +1 -0
- package/components/routes/help/ClientDocumentation.test.js +34 -0
- package/components/routes/help/Help.test.d.ts +1 -0
- package/components/routes/help/Help.test.js +57 -0
- package/components/routes/help/HitBannerDocumentation.test.d.ts +1 -0
- package/components/routes/help/HitBannerDocumentation.test.js +25 -0
- package/components/routes/help/HitDocumentation.test.d.ts +1 -0
- package/components/routes/help/HitDocumentation.test.js +53 -0
- package/components/routes/help/HitLabelsDocumentation.test.d.ts +1 -0
- package/components/routes/help/HitLabelsDocumentation.test.js +17 -0
- package/components/routes/help/HitLinksDocumentation.test.d.ts +1 -0
- package/components/routes/help/HitLinksDocumentation.test.js +27 -0
- package/components/routes/help/HitSchemaDocumentation.test.d.ts +1 -0
- package/components/routes/help/HitSchemaDocumentation.test.js +67 -0
- package/components/routes/help/NotebookDocumentation.test.d.ts +1 -0
- package/components/routes/help/NotebookDocumentation.test.js +34 -0
- package/components/routes/help/OverviewDocumentation.test.d.ts +1 -0
- package/components/routes/help/OverviewDocumentation.test.js +26 -0
- package/components/routes/help/RetentionDocumentation.test.d.ts +1 -0
- package/components/routes/help/RetentionDocumentation.test.js +61 -0
- package/components/routes/help/SearchDocumentation.test.d.ts +1 -0
- package/components/routes/help/SearchDocumentation.test.js +65 -0
- package/components/routes/help/TemplateDocumentation.test.d.ts +1 -0
- package/components/routes/help/TemplateDocumentation.test.js +58 -0
- package/components/routes/help/ViewDocumentation.test.d.ts +1 -0
- package/components/routes/help/ViewDocumentation.test.js +34 -0
- package/components/routes/help/components/HelpTabs.test.d.ts +1 -0
- package/components/routes/help/components/HelpTabs.test.js +26 -0
- package/components/routes/hits/search/InformationPane.test.d.ts +1 -0
- package/components/routes/hits/search/InformationPane.test.js +251 -0
- package/components/routes/hits/search/RecordBrowser.test.js +179 -51
- package/components/routes/hits/search/RecordQuery.test.d.ts +1 -0
- package/components/routes/hits/search/RecordQuery.test.js +117 -0
- package/components/routes/hits/search/SearchPane.test.d.ts +1 -0
- package/components/routes/hits/search/SearchPane.test.js +178 -0
- package/components/routes/hits/search/grid/RecordGrid.test.d.ts +1 -0
- package/components/routes/hits/search/grid/RecordGrid.test.js +107 -0
- package/components/routes/hits/search/shared/CustomSort.test.d.ts +1 -0
- package/components/routes/hits/search/shared/CustomSort.test.js +77 -0
- package/components/routes/hits/search/shared/HitFilter.test.d.ts +1 -0
- package/components/routes/hits/search/shared/HitFilter.test.js +83 -0
- package/components/routes/hits/search/shared/HitSort.test.d.ts +1 -0
- package/components/routes/hits/search/shared/HitSort.test.js +61 -0
- package/components/routes/hits/search/shared/LayoutSettings.test.d.ts +1 -0
- package/components/routes/hits/search/shared/LayoutSettings.test.js +84 -0
- package/components/routes/hits/search/shared/SearchSpan.test.d.ts +1 -0
- package/components/routes/hits/search/shared/SearchSpan.test.js +84 -0
- package/components/routes/home/AnalyticCard.test.d.ts +1 -0
- package/components/routes/home/AnalyticCard.test.js +87 -0
- package/components/routes/home/index.test.d.ts +1 -0
- package/components/routes/home/index.test.js +190 -0
- package/components/routes/overviews/OverviewViewer.test.d.ts +1 -0
- package/components/routes/overviews/OverviewViewer.test.js +151 -0
- package/components/routes/overviews/Overviews.test.d.ts +1 -0
- package/components/routes/overviews/Overviews.test.js +154 -0
- package/components/routes/settings/AdminSection.test.d.ts +1 -0
- package/components/routes/settings/AdminSection.test.js +26 -0
- package/components/routes/settings/LocalSection.test.d.ts +1 -0
- package/components/routes/settings/LocalSection.test.js +75 -0
- package/components/routes/settings/ProfileSection.test.d.ts +1 -0
- package/components/routes/settings/ProfileSection.test.js +95 -0
- package/components/routes/settings/SecuritySection.test.d.ts +1 -0
- package/components/routes/settings/SecuritySection.test.js +90 -0
- package/components/routes/settings/Settings.test.d.ts +1 -0
- package/components/routes/settings/Settings.test.js +60 -0
- package/components/routes/templates/TemplateEditor.test.d.ts +1 -0
- package/components/routes/templates/TemplateEditor.test.js +94 -0
- package/components/routes/templates/TemplateViewer.test.d.ts +1 -0
- package/components/routes/templates/TemplateViewer.test.js +145 -0
- package/components/routes/templates/Templates.test.d.ts +1 -0
- package/components/routes/templates/Templates.test.js +165 -0
- package/components/routes/views/ViewComposer.test.d.ts +1 -0
- package/components/routes/views/ViewComposer.test.js +320 -0
- package/components/routes/views/Views.test.d.ts +1 -0
- package/components/routes/views/Views.test.js +247 -0
- package/package.json +1 -1
- package/plugins/HowlerPlugin.test.d.ts +1 -0
- package/plugins/HowlerPlugin.test.js +103 -0
- package/plugins/clue/components/ClueChip.js +2 -2
- package/plugins/clue/helpers.test.d.ts +1 -0
- package/plugins/clue/helpers.test.js +100 -0
- package/plugins/store.test.d.ts +1 -0
- package/plugins/store.test.js +53 -0
- package/utils/classificationParser.test.d.ts +1 -0
- package/utils/classificationParser.test.js +199 -0
- package/utils/constants.test.d.ts +1 -0
- package/utils/constants.test.js +62 -0
- package/utils/typeUtils.test.d.ts +1 -0
- package/utils/typeUtils.test.js +22 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { applyClassificationRules, canSeeGroups, canSeeRequired, defaultClassificationValidator, defaultDisabled, defaultParts, getLevelText, getMaxClassification, getParts, isAccessible, normalizedClassification } from './classificationParser';
|
|
4
|
+
const classificationDefinition = {
|
|
5
|
+
RESTRICTED: 'S//REL TO CAN',
|
|
6
|
+
UNRESTRICTED: 'U',
|
|
7
|
+
access_req_aliases: {
|
|
8
|
+
CEO: ['CEO'],
|
|
9
|
+
OC: ['ORCON'],
|
|
10
|
+
ORCON: ['ORCON']
|
|
11
|
+
},
|
|
12
|
+
access_req_map_lts: {
|
|
13
|
+
'CANADIAN EYES ONLY': 'CEO',
|
|
14
|
+
'ORIGINATOR CONTROLLED': 'ORCON'
|
|
15
|
+
},
|
|
16
|
+
access_req_map_stl: {
|
|
17
|
+
CEO: 'CANADIAN EYES ONLY',
|
|
18
|
+
ORCON: 'ORIGINATOR CONTROLLED'
|
|
19
|
+
},
|
|
20
|
+
description: {},
|
|
21
|
+
dynamic_groups: false,
|
|
22
|
+
dynamic_groups_type: 'group',
|
|
23
|
+
enforce: true,
|
|
24
|
+
groups_aliases: {
|
|
25
|
+
'CANADA ONLY': ['CAN'],
|
|
26
|
+
FVEY: ['CAN', 'USA']
|
|
27
|
+
},
|
|
28
|
+
groups_auto_select: ['FVEY'],
|
|
29
|
+
groups_auto_select_short: ['FVEY'],
|
|
30
|
+
groups_map_lts: {
|
|
31
|
+
CANADA: 'CAN',
|
|
32
|
+
'FIVE EYES': 'FVEY',
|
|
33
|
+
'UNITED STATES': 'USA'
|
|
34
|
+
},
|
|
35
|
+
groups_map_stl: {
|
|
36
|
+
CAN: 'CANADA',
|
|
37
|
+
FVEY: 'FIVE EYES',
|
|
38
|
+
USA: 'UNITED STATES'
|
|
39
|
+
},
|
|
40
|
+
invalid_mode: false,
|
|
41
|
+
levels_aliases: {
|
|
42
|
+
PUBLIC: 'U'
|
|
43
|
+
},
|
|
44
|
+
levels_map: {
|
|
45
|
+
'0': 'U',
|
|
46
|
+
'1': 'C',
|
|
47
|
+
'2': 'S',
|
|
48
|
+
C: '1',
|
|
49
|
+
S: '2',
|
|
50
|
+
U: '0'
|
|
51
|
+
},
|
|
52
|
+
levels_map_lts: {
|
|
53
|
+
CONFIDENTIAL: 'C',
|
|
54
|
+
SECRET: 'S',
|
|
55
|
+
UNCLASSIFIED: 'U'
|
|
56
|
+
},
|
|
57
|
+
levels_map_stl: {
|
|
58
|
+
C: 'CONFIDENTIAL',
|
|
59
|
+
S: 'SECRET',
|
|
60
|
+
U: 'UNCLASSIFIED'
|
|
61
|
+
},
|
|
62
|
+
levels_styles_map: {},
|
|
63
|
+
original_definition: {
|
|
64
|
+
dynamic_groups: false,
|
|
65
|
+
dynamic_groups_type: 'group',
|
|
66
|
+
enforce: true,
|
|
67
|
+
groups: [],
|
|
68
|
+
levels: [],
|
|
69
|
+
required: [],
|
|
70
|
+
restricted: 'S//REL TO CAN',
|
|
71
|
+
subgroups: [],
|
|
72
|
+
unrestricted: 'U'
|
|
73
|
+
},
|
|
74
|
+
params_map: {
|
|
75
|
+
ALPHA: {
|
|
76
|
+
require_group: 'CAN'
|
|
77
|
+
},
|
|
78
|
+
BRAVO: {
|
|
79
|
+
limited_to_group: 'USA'
|
|
80
|
+
},
|
|
81
|
+
CAN: {
|
|
82
|
+
solitary_display_name: 'CANADA ONLY'
|
|
83
|
+
},
|
|
84
|
+
CEO: {
|
|
85
|
+
is_required_group: true,
|
|
86
|
+
require_lvl: 2
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
subgroups_aliases: {
|
|
90
|
+
ALPHA: ['ALPHA'],
|
|
91
|
+
BRAVO: ['BRAVO']
|
|
92
|
+
},
|
|
93
|
+
subgroups_auto_select: ['ALPHA TEAM'],
|
|
94
|
+
subgroups_auto_select_short: ['ALPHA'],
|
|
95
|
+
subgroups_map_lts: {
|
|
96
|
+
'ALPHA TEAM': 'ALPHA',
|
|
97
|
+
'BRAVO TEAM': 'BRAVO'
|
|
98
|
+
},
|
|
99
|
+
subgroups_map_stl: {
|
|
100
|
+
ALPHA: 'ALPHA TEAM',
|
|
101
|
+
BRAVO: 'BRAVO TEAM'
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const cloneParts = (parts) => ({
|
|
105
|
+
lvlIdx: parts.lvlIdx,
|
|
106
|
+
lvl: parts.lvl,
|
|
107
|
+
req: [...parts.req],
|
|
108
|
+
groups: [...parts.groups],
|
|
109
|
+
subgroups: [...parts.subgroups]
|
|
110
|
+
});
|
|
111
|
+
afterEach(() => {
|
|
112
|
+
vi.restoreAllMocks();
|
|
113
|
+
});
|
|
114
|
+
describe('classificationParser', () => {
|
|
115
|
+
it('exposes stable empty defaults for parser state', () => {
|
|
116
|
+
expect(defaultParts).toEqual({ lvlIdx: 0, lvl: '', req: [], groups: [], subgroups: [] });
|
|
117
|
+
expect(defaultDisabled).toEqual({ groups: [], levels: [] });
|
|
118
|
+
expect(defaultClassificationValidator).toEqual({ disabled: defaultDisabled, parts: defaultParts });
|
|
119
|
+
});
|
|
120
|
+
it('returns the short or long level label and reports unknown levels', () => {
|
|
121
|
+
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
122
|
+
expect(getLevelText(1, classificationDefinition, 'short', false)).toBe('C');
|
|
123
|
+
expect(getLevelText(1, classificationDefinition, 'long', false)).toBe('CONFIDENTIAL');
|
|
124
|
+
expect(getLevelText(99, classificationDefinition, 'short', false)).toBe('INVALID');
|
|
125
|
+
expect(errorSpy).toHaveBeenCalledWith("[classificationParser] Classification level number '99' was not found in your classification definition.");
|
|
126
|
+
});
|
|
127
|
+
it('parses levels, required markings, groups, and subgroups from short classifications', () => {
|
|
128
|
+
const parts = getParts('C//OC/REL TO CAN, USA/ALPHA', classificationDefinition, 'short', false);
|
|
129
|
+
expect(parts).toEqual({
|
|
130
|
+
lvlIdx: 1,
|
|
131
|
+
lvl: 'C',
|
|
132
|
+
req: ['ORCON'],
|
|
133
|
+
groups: ['CAN', 'USA'],
|
|
134
|
+
subgroups: ['ALPHA']
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
it('parses long-form classifications into long-form display values', () => {
|
|
138
|
+
const parts = getParts('CONFIDENTIAL//ORIGINATOR CONTROLLED/REL TO CANADA/ALPHA TEAM', classificationDefinition, 'long', false);
|
|
139
|
+
expect(parts).toEqual({
|
|
140
|
+
lvlIdx: 1,
|
|
141
|
+
lvl: 'CONFIDENTIAL',
|
|
142
|
+
req: ['ORIGINATOR CONTROLLED'],
|
|
143
|
+
groups: ['CANADA'],
|
|
144
|
+
subgroups: ['ALPHA TEAM']
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
it('checks required and group access using set semantics', () => {
|
|
148
|
+
expect(canSeeRequired(['ORCON', 'CEO'], ['ORCON'])).toBe(true);
|
|
149
|
+
expect(canSeeRequired(['ORCON'], ['ORCON', 'CEO'])).toBe(false);
|
|
150
|
+
expect(canSeeGroups(['CAN', 'USA'], ['USA'])).toBe(true);
|
|
151
|
+
expect(canSeeGroups(['CAN'], ['USA'])).toBe(false);
|
|
152
|
+
});
|
|
153
|
+
it('normalizes classifications with level escalation, solitary group names, and required groups', () => {
|
|
154
|
+
const normalized = normalizedClassification(cloneParts({
|
|
155
|
+
lvlIdx: 1,
|
|
156
|
+
lvl: 'C',
|
|
157
|
+
req: ['CEO'],
|
|
158
|
+
groups: [],
|
|
159
|
+
subgroups: ['ALPHA']
|
|
160
|
+
}), classificationDefinition, 'short', false, true);
|
|
161
|
+
expect(normalized).toBe('S//CEO/CANADA ONLY/ALPHA');
|
|
162
|
+
});
|
|
163
|
+
it('returns the unrestricted label when enforcement is disabled or invalid mode is active', () => {
|
|
164
|
+
expect(normalizedClassification(cloneParts(defaultParts), { ...classificationDefinition, enforce: false }, 'short', false)).toBe('U');
|
|
165
|
+
expect(normalizedClassification(cloneParts(defaultParts), { ...classificationDefinition, invalid_mode: true }, 'short', false)).toBe('U');
|
|
166
|
+
});
|
|
167
|
+
it('applies classification rules to raise levels, add required groups, and disable incompatible options', () => {
|
|
168
|
+
const result = applyClassificationRules(cloneParts({
|
|
169
|
+
lvlIdx: 0,
|
|
170
|
+
lvl: 'U',
|
|
171
|
+
req: ['CEO'],
|
|
172
|
+
groups: ['CAN', 'USA'],
|
|
173
|
+
subgroups: ['BRAVO']
|
|
174
|
+
}), classificationDefinition, 'long', false);
|
|
175
|
+
expect(result.parts.lvlIdx).toBe(2);
|
|
176
|
+
expect(result.parts.lvl).toBe('SECRET');
|
|
177
|
+
expect(result.parts.req).toEqual(['CANADIAN EYES ONLY']);
|
|
178
|
+
expect(result.parts.groups).toEqual(['UNITED STATES']);
|
|
179
|
+
expect(result.parts.subgroups).toEqual(['BRAVO TEAM']);
|
|
180
|
+
expect(result.disabled.levels).toEqual(['CONFIDENTIAL', 'UNCLASSIFIED']);
|
|
181
|
+
expect(result.disabled.groups).toContain('CANADA');
|
|
182
|
+
expect(result.disabled.groups).toContain('FIVE EYES');
|
|
183
|
+
});
|
|
184
|
+
it('returns the most restrictive classification across two inputs', () => {
|
|
185
|
+
const output = getMaxClassification('C//ORCON/REL TO CAN/ALPHA', 'S//REL TO CAN', classificationDefinition, 'short', false);
|
|
186
|
+
expect(output).toBe('S//ORCON//REL CAN, FVEY/ALPHA');
|
|
187
|
+
});
|
|
188
|
+
it('falls back to unrestricted max classification when enforcement is disabled', () => {
|
|
189
|
+
expect(getMaxClassification('C//REL TO CAN', 'S//REL TO USA', { ...classificationDefinition, enforce: false }, 'short', false)).toBe('U');
|
|
190
|
+
});
|
|
191
|
+
it('checks accessibility using level, required, group, and subgroup restrictions', () => {
|
|
192
|
+
expect(isAccessible('S//ORCON/REL TO CAN/ALPHA', 'C//ORCON/REL TO CAN/ALPHA', classificationDefinition, true)).toBe(true);
|
|
193
|
+
expect(isAccessible('C//REL TO CAN', 'S//REL TO CAN', classificationDefinition, true)).toBe(false);
|
|
194
|
+
expect(isAccessible('S//REL TO USA', 'S//REL TO CAN', classificationDefinition, true)).toBe(false);
|
|
195
|
+
expect(isAccessible('C//REL TO CAN', 'S//REL TO CAN', classificationDefinition, false)).toBe(true);
|
|
196
|
+
expect(isAccessible('S//REL TO CAN', '', classificationDefinition, true)).toBe(true);
|
|
197
|
+
expect(isAccessible('S//REL TO CAN', 'C//REL TO CAN', { ...classificationDefinition, invalid_mode: true }, true)).toBe(false);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
const loadConstants = async (isoDate = '2024-01-02T03:15:00Z') => {
|
|
3
|
+
vi.useFakeTimers();
|
|
4
|
+
vi.setSystemTime(new Date(isoDate));
|
|
5
|
+
vi.resetModules();
|
|
6
|
+
return import('./constants');
|
|
7
|
+
};
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
vi.useRealTimers();
|
|
10
|
+
vi.resetModules();
|
|
11
|
+
});
|
|
12
|
+
describe('constants', () => {
|
|
13
|
+
it('builds prefixed storage keys for mock stores', async () => {
|
|
14
|
+
const { MOCK_FAVOURITES_STORE, MOCK_SEARCH_QUERY_STORE, MY_LOCAL_STORAGE_PREFIX, StorageKey } = await loadConstants();
|
|
15
|
+
expect(MOCK_SEARCH_QUERY_STORE).toBe(`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.MOCK_SEARCH_QUERY_STORE}`);
|
|
16
|
+
expect(MOCK_FAVOURITES_STORE).toBe(`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.MOCK_FAVOURITES_STORE}`);
|
|
17
|
+
});
|
|
18
|
+
it('keeps storage key values stable for persisted UI state', async () => {
|
|
19
|
+
const { StorageKey } = await loadConstants();
|
|
20
|
+
expect(StorageKey.APP_TOKEN).toBe('app_token');
|
|
21
|
+
expect(StorageKey.ETAG).toBe('etag');
|
|
22
|
+
expect(StorageKey.LOGIN_NONCE).toBe('login_nonce');
|
|
23
|
+
expect(StorageKey.DISPLAY_TYPE).toBe('display_type');
|
|
24
|
+
});
|
|
25
|
+
it('computes the staggered rule intervals from the current time', async () => {
|
|
26
|
+
const { RULE_INTERVALS, hours, minutes } = await loadConstants();
|
|
27
|
+
expect(minutes).toEqual([15, 45]);
|
|
28
|
+
expect(hours).toEqual([0, 3, 6, 9, 12, 15, 18, 21]);
|
|
29
|
+
expect(RULE_INTERVALS).toEqual([
|
|
30
|
+
{ key: 'rule.interval.thirty.minutes', crontab: '15,45 * * * *' },
|
|
31
|
+
{ key: 'rule.interval.one.hour', crontab: '15 * * * *' },
|
|
32
|
+
{ key: 'rule.interval.three.hours', crontab: '15 0,3,6,9,12,15,18,21 * * *' },
|
|
33
|
+
{ key: 'rule.interval.six.hours', crontab: '15 3,9,15,21 * * *' },
|
|
34
|
+
{ key: 'rule.interval.one.day', crontab: '15 3 * * *' }
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
it('exports the supported date range presets and Lucene mappings', async () => {
|
|
38
|
+
const { DATE_RANGES, DATE_RANGE_LUCENE } = await loadConstants();
|
|
39
|
+
expect(DATE_RANGES).toEqual([
|
|
40
|
+
'date.range.1.day',
|
|
41
|
+
'date.range.3.day',
|
|
42
|
+
'date.range.1.week',
|
|
43
|
+
'date.range.1.month',
|
|
44
|
+
'date.range.all',
|
|
45
|
+
'date.range.custom'
|
|
46
|
+
]);
|
|
47
|
+
expect(DATE_RANGE_LUCENE).toEqual({
|
|
48
|
+
'date.range.1.day': 'now-1d/d',
|
|
49
|
+
'date.range.3.day': 'now-3d/d',
|
|
50
|
+
'date.range.1.week': 'now-7d/d',
|
|
51
|
+
'date.range.1.month': 'now-1M/M'
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
it('exposes configured label metadata for known label types', async () => {
|
|
55
|
+
const { LABEL_TYPES, VALID_ACTION_TRIGGERS, DEFAULT_QUERY } = await loadConstants();
|
|
56
|
+
expect(VALID_ACTION_TRIGGERS).toEqual(['create', 'promote', 'demote']);
|
|
57
|
+
expect(DEFAULT_QUERY).toBe('howler.id:*');
|
|
58
|
+
expect(LABEL_TYPES.insight.icon.props.fontSize).toBe('small');
|
|
59
|
+
expect(LABEL_TYPES.operation.color).toBeDefined();
|
|
60
|
+
expect(LABEL_TYPES.generic).toEqual({});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { isCase, isEvent, isHit } from './typeUtils';
|
|
4
|
+
describe('typeUtils', () => {
|
|
5
|
+
it('identifies hits by __index', () => {
|
|
6
|
+
expect(isHit({ __index: 'hit' })).toBe(true);
|
|
7
|
+
expect(isHit({ __index: 'event' })).toBe(false);
|
|
8
|
+
});
|
|
9
|
+
it('identifies cases by __index', () => {
|
|
10
|
+
expect(isCase({ __index: 'case' })).toBe(true);
|
|
11
|
+
expect(isCase({ __index: 'hit' })).toBe(false);
|
|
12
|
+
});
|
|
13
|
+
it('identifies events by __index', () => {
|
|
14
|
+
expect(isEvent({ __index: 'event' })).toBe(true);
|
|
15
|
+
expect(isEvent({ __index: 'case' })).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
it('returns false for nullish values and objects without an index', () => {
|
|
18
|
+
expect(isHit(null)).toBe(false);
|
|
19
|
+
expect(isCase(undefined)).toBe(false);
|
|
20
|
+
expect(isEvent({})).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
});
|