@databiosphere/findable-ui 25.0.0 → 25.1.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 (166) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +12 -0
  3. package/lib/components/Filter/components/ClearAllFilters/clearAllFilters.js +2 -1
  4. package/lib/components/Filter/components/Filter/filter.js +2 -1
  5. package/lib/components/Filter/components/Filters/filters.js +2 -1
  6. package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.d.ts +3 -2
  7. package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.js +2 -2
  8. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.js +3 -2
  9. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +2 -1
  10. package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +3 -2
  11. package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +1 -1
  12. package/lib/components/Index/components/EntitiesView/entitiesView.js +3 -2
  13. package/lib/components/Index/components/EntitiesView/types.d.ts +2 -2
  14. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +2 -1
  15. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -1
  16. package/lib/components/Layout/components/Sidebar/sidebar.js +4 -1
  17. package/lib/components/Table/components/Pagination/pagination.js +3 -2
  18. package/lib/components/Table/components/PaginationSummary/paginationSummary.js +2 -1
  19. package/lib/components/Table/components/TableRows/tableRows.js +7 -3
  20. package/lib/tests/testIds.d.ts +18 -0
  21. package/lib/tests/testIds.js +18 -0
  22. package/lib/theme/theme.js +4 -3
  23. package/lib/views/ExploreView/exploreView.js +2 -1
  24. package/package.json +1 -1
  25. package/src/components/Filter/components/ClearAllFilters/clearAllFilters.tsx +7 -1
  26. package/src/components/Filter/components/Filter/filter.tsx +2 -0
  27. package/src/components/Filter/components/Filters/filters.tsx +7 -1
  28. package/src/components/Filter/components/HighlightedLabel/highlightedLabel.tsx +4 -2
  29. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
  30. package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +2 -0
  31. package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
  32. package/src/components/Index/components/EntitiesView/entitiesView.tsx +2 -2
  33. package/src/components/Index/components/EntitiesView/types.ts +2 -2
  34. package/src/components/Index/components/Hero/components/ExportButton/exportButton.tsx +2 -0
  35. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -0
  36. package/src/components/Layout/components/Sidebar/sidebar.tsx +4 -1
  37. package/src/components/Table/components/Pagination/pagination.tsx +3 -2
  38. package/src/components/Table/components/PaginationSummary/paginationSummary.tsx +2 -1
  39. package/src/components/Table/components/TableRows/tableRows.tsx +10 -3
  40. package/src/tests/testIds.ts +18 -0
  41. package/src/theme/theme.ts +46 -43
  42. package/src/views/ExploreView/exploreView.tsx +2 -1
  43. package/tests/entitiesView.test.tsx +7 -11
  44. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
  45. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
  46. package/lib/components/Index/components/Cell/cell.d.ts +0 -7
  47. package/lib/components/Index/components/Cell/cell.js +0 -10
  48. package/lib/components/Index/components/EntitiesView/constants.d.ts +0 -1
  49. package/lib/components/Index/components/EntitiesView/constants.js +0 -1
  50. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +0 -8
  51. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +0 -57
  52. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +0 -4
  53. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +0 -10
  54. package/lib/components/Index/components/NTag/nTag.d.ts +0 -10
  55. package/lib/components/Index/components/NTag/nTag.js +0 -8
  56. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +0 -11
  57. package/lib/components/Index/components/NTagCell/nTagCell.js +0 -29
  58. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +0 -5
  59. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +0 -16
  60. package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
  61. package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
  62. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
  63. package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
  64. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +0 -6
  65. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +0 -10
  66. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +0 -5
  67. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +0 -29
  68. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
  69. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
  70. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
  71. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
  72. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
  73. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
  74. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
  75. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
  76. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
  77. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
  78. package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
  79. package/lib/components/Layout/components/Outline/common/constants.js +0 -1
  80. package/lib/components/Login/login.stories.d.ts +0 -6
  81. package/lib/components/Login/login.stories.js +0 -31
  82. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +0 -16
  83. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +0 -28
  84. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +0 -5
  85. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +0 -46
  86. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +0 -3
  87. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +0 -21
  88. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
  89. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
  90. package/lib/components/TableCreator/common/constants.d.ts +0 -6
  91. package/lib/components/TableCreator/common/constants.js +0 -19
  92. package/lib/components/TableCreator/common/entities.d.ts +0 -5
  93. package/lib/components/TableCreator/common/entities.js +0 -1
  94. package/lib/components/TableCreator/tableCreator.styles.d.ts +0 -4
  95. package/lib/components/TableCreator/tableCreator.styles.js +0 -4
  96. package/lib/components/common/Alert/alert.stories.d.ts +0 -6
  97. package/lib/components/common/Alert/alert.stories.js +0 -36
  98. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
  99. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
  100. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
  101. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
  102. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
  103. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
  104. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
  105. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
  106. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
  107. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
  108. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +0 -3
  109. package/lib/components/common/Button/components/LoginButton/loginButton.js +0 -6
  110. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +0 -7
  111. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +0 -11
  112. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
  113. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
  114. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
  115. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
  116. package/lib/hooks/useAuthentication/common/constants.d.ts +0 -4
  117. package/lib/hooks/useAuthentication/common/constants.js +0 -19
  118. package/lib/hooks/useAuthentication/common/entities.d.ts +0 -25
  119. package/lib/hooks/useAuthentication/common/entities.js +0 -11
  120. package/lib/hooks/useAuthentication/common/utils.d.ts +0 -15
  121. package/lib/hooks/useAuthentication/common/utils.js +0 -25
  122. package/lib/hooks/useAuthentication/useAuthentication.d.ts +0 -6
  123. package/lib/hooks/useAuthentication/useAuthentication.js +0 -9
  124. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +0 -6
  125. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +0 -55
  126. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +0 -20
  127. package/lib/hooks/useAuthentication/useAuthenticationForm.js +0 -88
  128. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +0 -18
  129. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +0 -50
  130. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +0 -20
  131. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +0 -32
  132. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +0 -21
  133. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +0 -41
  134. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +0 -18
  135. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +0 -62
  136. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +0 -24
  137. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +0 -62
  138. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +0 -15
  139. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +0 -62
  140. package/lib/hooks/useAuthentication/useTokenClient.d.ts +0 -11
  141. package/lib/hooks/useAuthentication/useTokenClient.js +0 -29
  142. package/lib/hooks/useAuthenticationConfig.d.ts +0 -6
  143. package/lib/hooks/useAuthenticationConfig.js +0 -14
  144. package/lib/hooks/useCategoryConfigs.d.ts +0 -6
  145. package/lib/hooks/useCategoryConfigs.js +0 -17
  146. package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
  147. package/lib/hooks/useEntityListRelatedView.js +0 -62
  148. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
  149. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -27
  150. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
  151. package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
  152. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -9
  153. package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -37
  154. package/lib/hooks/useLayoutState.d.ts +0 -6
  155. package/lib/hooks/useLayoutState.js +0 -9
  156. package/lib/hooks/useMenu.d.ts +0 -10
  157. package/lib/hooks/useMenu.js +0 -17
  158. package/lib/hooks/useMenuWithPosition.d.ts +0 -14
  159. package/lib/hooks/useMenuWithPosition.js +0 -33
  160. package/lib/hooks/useSessionTimeout.d.ts +0 -11
  161. package/lib/hooks/useSessionTimeout.js +0 -28
  162. package/lib/providers/authentication.d.ts +0 -51
  163. package/lib/providers/authentication.js +0 -110
  164. package/lib/providers/layoutState.d.ts +0 -40
  165. package/lib/providers/layoutState.js +0 -47
  166. package/src/components/Index/components/EntitiesView/constants.ts +0 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "25.0.0"
2
+ ".": "25.1.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [25.1.0](https://github.com/DataBiosphere/findable-ui/compare/v25.0.0...v25.1.0) (2025-04-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * add test ids to key testable components ([#401](https://github.com/DataBiosphere/findable-ui/issues/401)) ([#403](https://github.com/DataBiosphere/findable-ui/issues/403)) ([99a41f8](https://github.com/DataBiosphere/findable-ui/commit/99a41f8661d0794d20b4e610a24c9fe1b8fbc4f1))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix theme with deepmerge ([#399](https://github.com/DataBiosphere/findable-ui/issues/399)) ([#400](https://github.com/DataBiosphere/findable-ui/issues/400)) ([981d8f9](https://github.com/DataBiosphere/findable-ui/commit/981d8f9fb2a1acce20707d558c9880dc63af7485))
14
+
3
15
  ## [25.0.0](https://github.com/DataBiosphere/findable-ui/compare/v24.0.0...v25.0.0) (2025-04-11)
4
16
 
5
17
 
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { useExploreState } from "../../../../hooks/useExploreState";
3
3
  import { ExploreActionKind } from "../../../../providers/exploreState";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { ButtonTextPrimary } from "../../../common/Button/components/ButtonTextPrimary/buttonTextPrimary";
5
6
  export const ClearAllFilters = () => {
6
7
  const { exploreDispatch } = useExploreState();
@@ -10,5 +11,5 @@ export const ClearAllFilters = () => {
10
11
  type: ExploreActionKind.ClearFilters,
11
12
  });
12
13
  };
13
- return (React.createElement(ButtonTextPrimary, { onClick: onClearFilters }, "Clear All"));
14
+ return (React.createElement(ButtonTextPrimary, { "data-testid": TEST_IDS.CLEAR_ALL_FILTERS, onClick: onClearFilters }, "Clear All"));
14
15
  };
@@ -1,6 +1,7 @@
1
1
  import { CloseRounded } from "@mui/icons-material";
2
2
  import { Grow } from "@mui/material";
3
3
  import React, { useState } from "react";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { FilterLabel } from "../FilterLabel/filterLabel";
5
6
  import { FilterMenu } from "../FilterMenu/filterMenu";
6
7
  import { DrawerTransition } from "./components/DrawerTransition/drawerTransition";
@@ -49,7 +50,7 @@ export const Filter = ({ categorySection, categoryView, closeAncestor, isFilterD
49
50
  };
50
51
  return (React.createElement(React.Fragment, null,
51
52
  React.createElement(FilterLabel, { annotation: categoryView.annotation, count: categoryView.values.length, disabled: categoryView.isDisabled, isOpen: isOpen, label: categoryView.label, onClick: onOpenFilter }),
52
- React.createElement(FilterPopover, { anchorPosition: anchorPosition, anchorReference: "anchorPosition", marginThreshold: 0, onClose: onCloseFilters, open: isOpen, slotProps: slotProps, TransitionComponent: TransitionComponent, transitionDuration: TransitionDuration },
53
+ React.createElement(FilterPopover, { anchorPosition: anchorPosition, anchorReference: "anchorPosition", "data-testid": TEST_IDS.FILTER_POPOVER, marginThreshold: 0, onClose: onCloseFilters, open: isOpen, slotProps: slotProps, TransitionComponent: TransitionComponent, transitionDuration: TransitionDuration },
53
54
  isOpen && isFilterDrawer && (React.createElement(IconButton, { Icon: CloseRounded, onClick: onCloseFilters, size: "medium" })),
54
55
  React.createElement(FilterMenu, { categorySection: categorySection, categoryKey: categoryView.key, categoryLabel: categoryView.label, isFilterDrawer: isFilterDrawer, onFilter: onFilter, onCloseFilter: onCloseFilter, values: categoryView.values })),
55
56
  tags));
@@ -2,6 +2,7 @@ import { Divider } from "@mui/material";
2
2
  import React, { Fragment, useEffect, useRef, useState } from "react";
3
3
  import { BREAKPOINT_FN_NAME, useBreakpointHelper, } from "../../../../hooks/useBreakpointHelper";
4
4
  import { useWindowResize } from "../../../../hooks/useWindowResize";
5
+ import { TEST_IDS } from "../../../../tests/testIds";
5
6
  import { DESKTOP_SM } from "../../../../theme/common/breakpoints";
6
7
  import { Filter } from "../Filter/filter";
7
8
  import { FilterTags } from "../FilterTags/filterTags";
@@ -42,7 +43,7 @@ export const Filters = ({ categoryFilters, closeAncestor, disabled = false, onFi
42
43
  useEffect(() => {
43
44
  setHeight(calculateListHeight(windowHeight, filterListRef.current));
44
45
  }, [windowHeight]);
45
- return (React.createElement(FilterList, { disabled: disabled, height: height, ref: filterListRef }, categoryFilters.map(({ categoryViews, label }, i) => (React.createElement(Fragment, { key: i },
46
+ return (React.createElement(FilterList, { "data-testid": TEST_IDS.FILTERS, disabled: disabled, height: height, ref: filterListRef }, categoryFilters.map(({ categoryViews, label }, i) => (React.createElement(Fragment, { key: i },
46
47
  i !== 0 && React.createElement(Divider, null),
47
48
  label && React.createElement(CategoryViewsLabel, null, label),
48
49
  categoryViews.map((categoryView) => (React.createElement(Filter, { key: categoryView.key, categorySection: label, categoryView: categoryView, closeAncestor: closeAncestor, isFilterDrawer: isFilterDrawer, onFilter: onFilter, trackFilterOpened: trackFilterOpened, tags: renderFilterTags(categoryView, onFilter) }))))))));
@@ -1,7 +1,8 @@
1
+ import { TestIdProps } from "../../../types";
1
2
  import { FilterMenuSearchMatchRange } from "../../common/entities";
2
- interface HighlightedLabelProps {
3
+ interface HighlightedLabelProps extends TestIdProps {
3
4
  label: string;
4
5
  ranges?: FilterMenuSearchMatchRange[];
5
6
  }
6
- export declare const HighlightedLabel: ({ label, ranges, }: HighlightedLabelProps) => JSX.Element;
7
+ export declare const HighlightedLabel: ({ label, ranges, testId, }: HighlightedLabelProps) => JSX.Element;
7
8
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { MatchHighlight } from "./highlightedLabel.styles";
3
- export const HighlightedLabel = ({ label, ranges, }) => {
3
+ export const HighlightedLabel = ({ label, ranges, testId, }) => {
4
4
  const items = [];
5
5
  if (ranges) {
6
6
  ranges = ranges.slice().sort(({ start: a }, { start: b }) => a - b);
@@ -29,5 +29,5 @@ export const HighlightedLabel = ({ label, ranges, }) => {
29
29
  else {
30
30
  items.push(label);
31
31
  }
32
- return React.createElement("span", null, items);
32
+ return React.createElement("span", { "data-testid": testId }, items);
33
33
  };
@@ -1,5 +1,6 @@
1
1
  import { Checkbox, ListItemButton, ListItemText, ListSubheader, Typography, } from "@mui/material";
2
2
  import React, { useEffect, useRef } from "react";
3
+ import { TEST_IDS } from "../../../../../../tests/testIds";
3
4
  import { TEXT_BODY_SMALL_400 } from "../../../../../../theme/common/typography";
4
5
  import { CheckedIcon } from "../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
5
6
  import { UncheckedIcon } from "../../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
@@ -18,9 +19,9 @@ export default function VariableSizeListItem({ item, onFilter, onUpdateItemSizeB
18
19
  }, [key, onUpdateItemSizeByItemKey]);
19
20
  if (item.type === ITEM_TYPE.VALUE) {
20
21
  const { categoryKey, matchRanges, value: { count, key: valueKey, label, selected }, } = item;
21
- return (React.createElement(ListItemButton, { ref: setRef, key: key, onClick: () => onFilter(categoryKey, valueKey, !selected, undefined, searchTerm), selected: selected, style: style },
22
+ return (React.createElement(ListItemButton, { "data-testid": TEST_IDS.FILTER_ITEM, ref: setRef, key: key, onClick: () => onFilter(categoryKey, valueKey, !selected, undefined, searchTerm), selected: selected, style: style },
22
23
  React.createElement(Checkbox, { checked: selected, checkedIcon: React.createElement(CheckedIcon, null), icon: React.createElement(UncheckedIcon, null) }),
23
- React.createElement(ListItemText, { disableTypography: true, primary: React.createElement(HighlightedLabel, { label: label, ranges: matchRanges }), secondary: React.createElement(Typography, { color: "ink.light", variant: TEXT_BODY_SMALL_400 }, count) })));
24
+ React.createElement(ListItemText, { disableTypography: true, primary: React.createElement(HighlightedLabel, { label: label, ranges: matchRanges, testId: TEST_IDS.FILTER_TERM }), secondary: React.createElement(Typography, { color: "ink.light", "data-testid": TEST_IDS.FILTER_COUNT, variant: TEXT_BODY_SMALL_400 }, count) })));
24
25
  }
25
26
  else if (item.type === ITEM_TYPE.CATEGORY) {
26
27
  return (React.createElement(ListSubheader, { key: key, ref: setRef, style: style }, item.categoryLabel));
@@ -1,6 +1,7 @@
1
1
  import React, { createContext, useContext, useEffect, useRef, useState, } from "react";
2
2
  import { SELECTOR } from "../../../../common/selectors";
3
3
  import { BREAKPOINT_FN_NAME, useBreakpointHelper, } from "../../../../hooks/useBreakpointHelper";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { DESKTOP_SM } from "../../../../theme/common/breakpoints";
5
6
  import { SearchCloseButton } from "../SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton";
6
7
  import { SearchAllFiltersSearch } from "../SearchAllFiltersSearch/searchAllFiltersSearch";
@@ -85,7 +86,7 @@ export const SearchAllFilters = ({ categoryViews, drawerOpen = false, onFilter,
85
86
  open,
86
87
  searchTerm,
87
88
  } },
88
- React.createElement(Autocomplete, { clearOnBlur: desktopSmUp, filterOptions: (options) => options, freeSolo: true, ListboxComponent: Listbox, onBlur: desktopSmUp ? onCloseSearch : undefined, onClose: desktopSmUp ? onCloseSearch : undefined, onFocus: onOpenSearch, onOpen: onOpen, open: open, options: [""], PopperComponent: AutocompletePopper, ref: autocompleteRef, renderInput: (props) => renderInput({
89
+ React.createElement(Autocomplete, { clearOnBlur: desktopSmUp, "data-testid": TEST_IDS.SEARCH_ALL_FILTERS, filterOptions: (options) => options, freeSolo: true, ListboxComponent: Listbox, onBlur: desktopSmUp ? onCloseSearch : undefined, onClose: desktopSmUp ? onCloseSearch : undefined, onFocus: onOpenSearch, onOpen: onOpen, open: open, options: [""], PopperComponent: AutocompletePopper, ref: autocompleteRef, renderInput: (props) => renderInput({
89
90
  ...props,
90
91
  InputProps: {
91
92
  ...props.InputProps,
@@ -1,6 +1,7 @@
1
1
  import { Checkbox, ListItemButton, ListItemText, Typography, } from "@mui/material";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import { SELECT_CATEGORY_KEY } from "../../../../providers/exploreState/constants";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { TEXT_BODY_SMALL_400 } from "../../../../theme/common/typography";
5
6
  import { CheckedIcon } from "../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
6
7
  import { UncheckedIcon } from "../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
@@ -16,7 +17,7 @@ export default function VariableSizeListItem({ categoryKey, categorySection, mat
16
17
  const handleItemClicked = () => {
17
18
  onFilter(categoryKey, key, !selected, categorySection);
18
19
  };
19
- return (React.createElement(ListItemButton, { ref: listItemRef, onClick: handleItemClicked, selected: selected, style: style },
20
+ return (React.createElement(ListItemButton, { "data-testid": TEST_IDS.FILTER_ITEM, ref: listItemRef, onClick: handleItemClicked, selected: selected, style: style },
20
21
  React.createElement(Checkbox, { checked: selected, checkedIcon: React.createElement(CheckedIcon, null), icon: React.createElement(UncheckedIcon, null) }),
21
- React.createElement(ListItemText, { disableTypography: true, primary: React.createElement(HighlightedLabel, { label: label, ranges: labelRanges }), secondary: categoryKey !== SELECT_CATEGORY_KEY.SAVED_FILTERS && (React.createElement(Typography, { color: "ink.light", variant: TEXT_BODY_SMALL_400 }, count)) })));
22
+ React.createElement(ListItemText, { disableTypography: true, primary: React.createElement(HighlightedLabel, { label: label, ranges: labelRanges, testId: TEST_IDS.FILTER_TERM }), secondary: categoryKey !== SELECT_CATEGORY_KEY.SAVED_FILTERS && (React.createElement(Typography, { color: "ink.light", "data-testid": TEST_IDS.FILTER_COUNT, variant: TEXT_BODY_SMALL_400 }, count)) })));
22
23
  }
@@ -1,2 +1,2 @@
1
1
  import { EntitiesViewProps } from "./types";
2
- export declare const EntitiesView: ({ children, onChange, testId, viewMode, viewStatus, }: EntitiesViewProps) => JSX.Element;
2
+ export declare const EntitiesView: ({ children, onChange, viewMode, viewStatus, }: EntitiesViewProps) => JSX.Element;
@@ -1,10 +1,11 @@
1
1
  import { ToggleButton, ToggleButtonGroup, Toolbar } from "@mui/material";
2
2
  import React from "react";
3
+ import { TEST_IDS } from "../../../../tests/testIds";
3
4
  import { GridPaper } from "../../../common/Paper/paper.styles";
4
5
  import { StyledFluidPaper } from "./entitiesView.styles";
5
6
  import { VIEW_MODE } from "./hooks/UseEntitiesView/types";
6
- export const EntitiesView = ({ children, onChange, testId, viewMode, viewStatus, }) => {
7
- return (React.createElement(StyledFluidPaper, { testId: testId },
7
+ export const EntitiesView = ({ children, onChange, viewMode, viewStatus, }) => {
8
+ return (React.createElement(StyledFluidPaper, { testId: TEST_IDS.ENTITIES_VIEW },
8
9
  React.createElement(GridPaper, null,
9
10
  viewStatus.disabled ? null : (React.createElement(Toolbar, null,
10
11
  React.createElement(ToggleButtonGroup, { exclusive: true, value: viewMode, onChange: onChange },
@@ -1,7 +1,7 @@
1
1
  import { ToggleButtonGroupProps } from "@mui/material";
2
- import { ChildrenProps, TestIdProps } from "../../../types";
2
+ import { ChildrenProps } from "../../../types";
3
3
  import { VIEW_MODE, ViewStatus } from "./hooks/UseEntitiesView/types";
4
- export interface EntitiesViewProps extends ChildrenProps, TestIdProps {
4
+ export interface EntitiesViewProps extends ChildrenProps {
5
5
  onChange: ToggleButtonGroupProps["onChange"];
6
6
  viewMode: VIEW_MODE;
7
7
  viewStatus: ViewStatus;
@@ -2,11 +2,12 @@ import { Tooltip } from "@mui/material";
2
2
  import Link from "next/link";
3
3
  import React from "react";
4
4
  import { useDownloadStatus } from "../../../../../../hooks/useDownloadStatus";
5
+ import { TEST_IDS } from "../../../../../../tests/testIds";
5
6
  import { Button } from "./exportButton.styles";
6
7
  export const ExportButton = () => {
7
8
  const { disabled, isLoading, message } = useDownloadStatus();
8
9
  return (React.createElement(Tooltip, { arrow: true, title: message },
9
10
  React.createElement("span", null,
10
11
  React.createElement(Link, { href: "/export", legacyBehavior: true, passHref: true },
11
- React.createElement(Button, { disabled: disabled || isLoading, href: "passHref", id: "button-cohort-export" }, "Export")))));
12
+ React.createElement(Button, { "data-testid": TEST_IDS.EXPORT_BUTTON, disabled: disabled || isLoading, href: "passHref", id: "button-cohort-export" }, "Export")))));
12
13
  };
@@ -1,5 +1,6 @@
1
1
  import { CloseRounded } from "@mui/icons-material";
2
2
  import React from "react";
3
+ import { TEST_IDS } from "../../../../../../tests/testIds";
3
4
  import { DrawerTransition } from "../../../../../Filter/components/Filter/components/DrawerTransition/drawerTransition";
4
5
  import { IconButton, TemporarySidebar } from "./sidebarDrawer.styles";
5
6
  const DEFAULT_POSITION = { left: 0, top: 0 };
@@ -8,7 +9,7 @@ const DRAWER_SLOT_PROPS = {
8
9
  root: { slotProps: { backdrop: { invisible: false } } },
9
10
  };
10
11
  export const SidebarDrawer = ({ children, drawerOpen = false, onDrawerClose, }) => {
11
- return (React.createElement(TemporarySidebar, { anchorPosition: DEFAULT_POSITION, anchorReference: "anchorPosition", hideBackdrop: false, marginThreshold: 0, onClose: onDrawerClose, open: drawerOpen, slotProps: DRAWER_SLOT_PROPS, TransitionComponent: DrawerTransition, transitionDuration: drawerOpen ? 250 : 300 },
12
+ return (React.createElement(TemporarySidebar, { anchorPosition: DEFAULT_POSITION, anchorReference: "anchorPosition", "data-testid": TEST_IDS.SIDEBAR_DRAWER, hideBackdrop: false, marginThreshold: 0, onClose: onDrawerClose, open: drawerOpen, slotProps: DRAWER_SLOT_PROPS, TransitionComponent: DrawerTransition, transitionDuration: drawerOpen ? 250 : 300 },
12
13
  React.createElement(IconButton, { Icon: CloseRounded, onClick: onDrawerClose, size: "medium" }),
13
14
  children));
14
15
  };
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect } from "react";
2
2
  import { BREAKPOINT_FN_NAME, useBreakpointHelper, } from "../../../../hooks/useBreakpointHelper";
3
+ import { TEST_IDS } from "../../../../tests/testIds";
3
4
  import { DESKTOP_SM } from "../../../../theme/common/breakpoints";
4
5
  import { SidebarDrawer } from "./components/SidebarDrawer/sidebarDrawer";
5
6
  import { SidebarPositioner } from "./components/SidebarPositioner/sidebarPositioner";
@@ -9,7 +10,9 @@ export const Sidebar = ({ children, drawerOpen, onDrawerClose, }) => {
9
10
  const controlledSidebar = typeof drawerOpen === "boolean";
10
11
  const drawerSidebar = controlledSidebar && desktopSmDown; // Sidebar is "temporary" drawer when drawerOpen is defined and breakpoint is smaller than the breakpoint.
11
12
  const Bar = drawerSidebar ? SidebarDrawer : PermanentSidebar;
12
- const barProps = drawerSidebar ? { drawerOpen, onDrawerClose } : {};
13
+ const barProps = drawerSidebar
14
+ ? { drawerOpen, onDrawerClose }
15
+ : { "data-testid": TEST_IDS.SIDEBAR };
13
16
  // Closes an open, controlled drawer sidebar with a change of breakpoint.
14
17
  useEffect(() => {
15
18
  if (drawerOpen && !desktopSmDown) {
@@ -1,12 +1,13 @@
1
1
  import { EastRounded, WestRounded } from "@mui/icons-material";
2
2
  import { Typography } from "@mui/material";
3
3
  import React from "react";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { IconButton } from "../../../common/IconButton/iconButton";
5
6
  import { Stack } from "../../../common/Stack/stack";
6
7
  import { Pagination as TablePagination } from "./pagination.styles";
7
8
  export const Pagination = ({ canNextPage = true, canPreviousPage = true, currentPage, onNextPage, onPreviousPage, totalPage, }) => {
8
- return (React.createElement(TablePagination, null,
9
- React.createElement("div", null,
9
+ return (React.createElement(TablePagination, { "data-testid": TEST_IDS.TABLE_PAGINATION },
10
+ React.createElement("div", { "data-testid": TEST_IDS.TABLE_PAGINATION_PAGE },
10
11
  React.createElement(Typography, { variant: "text-body-400" }, "Page "),
11
12
  React.createElement(Typography, { variant: "text-body-500" },
12
13
  currentPage,
@@ -1,8 +1,9 @@
1
1
  import { Fade, Typography } from "@mui/material";
2
2
  import React from "react";
3
+ import { TEST_IDS } from "../../../../tests/testIds";
3
4
  export const PaginationSummary = ({ firstResult, lastResult, totalResult, }) => {
4
5
  return (React.createElement(Fade, { in: totalResult > 0 },
5
- React.createElement("div", null,
6
+ React.createElement("div", { "data-testid": TEST_IDS.TABLE_PAGINATION_RESULTS },
6
7
  React.createElement(Typography, { variant: "text-body-400" }, "Results "),
7
8
  React.createElement(Typography, { variant: "text-body-small-500" },
8
9
  firstResult,
@@ -1,19 +1,23 @@
1
1
  import { TableCell } from "@mui/material";
2
2
  import { flexRender } from "@tanstack/react-table";
3
3
  import React, { Fragment } from "react";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { getTableCellAlign, getTableCellPadding, } from "../TableCell/common/utils";
5
6
  import { TableRow } from "../TableRow/tableRow.styles";
6
7
  export const TableRows = ({ rows, virtualizer, }) => {
7
8
  const virtualItems = virtualizer.getVirtualItems();
8
9
  return (React.createElement(Fragment, null, virtualItems.map((virtualRow) => {
9
- const row = rows[virtualRow.index];
10
+ const rowIndex = virtualRow.index;
11
+ const row = rows[rowIndex];
10
12
  const { getIsGrouped, getIsPreview } = row;
11
- return (React.createElement(TableRow, { key: row.id, "data-index": virtualRow.index, isGrouped: getIsGrouped(), isPreview: getIsPreview(), ref: virtualizer.measureElement }, row.getVisibleCells().map((cell) => {
13
+ return (React.createElement(TableRow, { key: row.id, "data-index": rowIndex, isGrouped: getIsGrouped(), isPreview: getIsPreview(), ref: virtualizer.measureElement }, row.getVisibleCells().map((cell, i) => {
12
14
  if (cell.getIsAggregated())
13
15
  return null; // Display of aggregated cells is currently not supported.
14
16
  if (cell.getIsPlaceholder())
15
17
  return null; // Display of placeholder cells is currently not supported.
16
- return (React.createElement(TableCell, { key: cell.id, align: getTableCellAlign(cell.column), padding: getTableCellPadding(cell.column.id) }, flexRender(cell.column.columnDef.cell, cell.getContext())));
18
+ return (React.createElement(TableCell, { "data-testid": rowIndex === 0 && i === 0
19
+ ? TEST_IDS.TABLE_FIRST_CELL
20
+ : undefined, key: cell.id, align: getTableCellAlign(cell.column), padding: getTableCellPadding(cell.column.id) }, flexRender(cell.column.columnDef.cell, cell.getContext())));
17
21
  })));
18
22
  })));
19
23
  };
@@ -0,0 +1,18 @@
1
+ export declare const TEST_IDS: {
2
+ CLEAR_ALL_FILTERS: string;
3
+ ENTITIES_VIEW: string;
4
+ EXPORT_BUTTON: string;
5
+ FILTERS: string;
6
+ FILTER_CONTROLS: string;
7
+ FILTER_COUNT: string;
8
+ FILTER_ITEM: string;
9
+ FILTER_POPOVER: string;
10
+ FILTER_TERM: string;
11
+ SEARCH_ALL_FILTERS: string;
12
+ SIDEBAR: string;
13
+ SIDEBAR_DRAWER: string;
14
+ TABLE_FIRST_CELL: string;
15
+ TABLE_PAGINATION: string;
16
+ TABLE_PAGINATION_PAGE: string;
17
+ TABLE_PAGINATION_RESULTS: string;
18
+ };
@@ -0,0 +1,18 @@
1
+ export const TEST_IDS = {
2
+ CLEAR_ALL_FILTERS: "clear-all-filters",
3
+ ENTITIES_VIEW: "entities-view",
4
+ EXPORT_BUTTON: "export-button",
5
+ FILTERS: "filters",
6
+ FILTER_CONTROLS: "filter-controls",
7
+ FILTER_COUNT: "filter-count",
8
+ FILTER_ITEM: "filter-item",
9
+ FILTER_POPOVER: "filter-popover",
10
+ FILTER_TERM: "filter-term",
11
+ SEARCH_ALL_FILTERS: "search-all-filters",
12
+ SIDEBAR: "sidebar",
13
+ SIDEBAR_DRAWER: "sidebar-drawer",
14
+ TABLE_FIRST_CELL: "table-first-cell",
15
+ TABLE_PAGINATION: "table-pagination",
16
+ TABLE_PAGINATION_PAGE: "table-pagination-page",
17
+ TABLE_PAGINATION_RESULTS: "table-pagination-results",
18
+ };
@@ -1,4 +1,5 @@
1
1
  import { createTheme } from "@mui/material";
2
+ import { deepmerge } from "@mui/utils";
2
3
  import * as B from "./common/breakpoints";
3
4
  import * as C from "./common/components";
4
5
  import * as P from "./common/palette";
@@ -10,9 +11,9 @@ import * as M from "./components";
10
11
  * @param customOptions - Custom theme option overrides.
11
12
  * @returns theme with custom theme overrides.
12
13
  */
13
- export function createAppTheme(customOptions) {
14
+ export function createAppTheme(customOptions = {}) {
14
15
  // Generate default theme with custom overrides.
15
- const theme = createTheme({
16
+ const theme = createTheme(deepmerge({
16
17
  breakpoints: {
17
18
  values: {
18
19
  lg: B.desktop,
@@ -54,7 +55,7 @@ export function createAppTheme(customOptions) {
54
55
  [T.TEXT_UPPERCASE_500]: T.textUppercase500,
55
56
  fontFamily: T.fontFamily,
56
57
  },
57
- }, { ...customOptions });
58
+ }, customOptions));
58
59
  // Default shadow overrides.
59
60
  theme.shadows = [...theme.shadows].map((shadow, s) => shadows[s] || shadow);
60
61
  // Theme components.
@@ -20,6 +20,7 @@ import { useExploreState } from "../../hooks/useExploreState";
20
20
  import { useSummary } from "../../hooks/useSummary";
21
21
  import { ExploreActionKind } from "../../providers/exploreState";
22
22
  import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
23
+ import { TEST_IDS } from "../../tests/testIds";
23
24
  import { DESKTOP_SM } from "../../theme/common/breakpoints";
24
25
  export const ExploreView = (props) => {
25
26
  const [isDrawerOpen, setIsDrawerOpen] = useState(false);
@@ -99,7 +100,7 @@ export const ExploreView = (props) => {
99
100
  }, [entityListType, exploreDispatch]);
100
101
  return (React.createElement(React.Fragment, null,
101
102
  categoryViews && !!categoryViews.length && (React.createElement(Sidebar, { drawerOpen: isDrawerOpen, onDrawerClose: onCloseDrawer },
102
- React.createElement(SidebarTools, null,
103
+ React.createElement(SidebarTools, { "data-testid": TEST_IDS.FILTER_CONTROLS },
103
104
  React.createElement(SidebarLabel, { label: "Filters" }),
104
105
  React.createElement(ClearAllFilters, null),
105
106
  React.createElement(SearchAllFilters, { categoryViews: categoryViews, drawerOpen: isDrawerOpen, onFilter: onFilterChange.bind(null, true) })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "25.0.0",
3
+ "version": "25.1.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { useExploreState } from "../../../../hooks/useExploreState";
3
3
  import { ExploreActionKind } from "../../../../providers/exploreState";
4
+ import { TEST_IDS } from "../../../../tests/testIds";
4
5
  import { ButtonTextPrimary } from "../../../common/Button/components/ButtonTextPrimary/buttonTextPrimary";
5
6
 
6
7
  export const ClearAllFilters = (): JSX.Element => {
@@ -14,6 +15,11 @@ export const ClearAllFilters = (): JSX.Element => {
14
15
  };
15
16
 
16
17
  return (
17
- <ButtonTextPrimary onClick={onClearFilters}>Clear All</ButtonTextPrimary>
18
+ <ButtonTextPrimary
19
+ data-testid={TEST_IDS.CLEAR_ALL_FILTERS}
20
+ onClick={onClearFilters}
21
+ >
22
+ Clear All
23
+ </ButtonTextPrimary>
18
24
  );
19
25
  };
@@ -4,6 +4,7 @@ import React, { MouseEvent, ReactNode, useState } from "react";
4
4
  import { SelectCategoryView } from "../../../../common/entities";
5
5
  import { TrackFilterOpenedFunction } from "../../../../config/entities";
6
6
  import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
7
+ import { TEST_IDS } from "../../../../tests/testIds";
7
8
  import { FilterLabel } from "../FilterLabel/filterLabel";
8
9
  import { FilterMenu } from "../FilterMenu/filterMenu";
9
10
  import { DrawerTransition } from "./components/DrawerTransition/drawerTransition";
@@ -87,6 +88,7 @@ export const Filter = ({
87
88
  <FilterPopover
88
89
  anchorPosition={anchorPosition}
89
90
  anchorReference="anchorPosition"
91
+ data-testid={TEST_IDS.FILTER_POPOVER}
90
92
  marginThreshold={0}
91
93
  onClose={onCloseFilters}
92
94
  open={isOpen}
@@ -8,6 +8,7 @@ import {
8
8
  } from "../../../../hooks/useBreakpointHelper";
9
9
  import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
10
10
  import { useWindowResize } from "../../../../hooks/useWindowResize";
11
+ import { TEST_IDS } from "../../../../tests/testIds";
11
12
  import { DESKTOP_SM } from "../../../../theme/common/breakpoints";
12
13
  import { Filter } from "../Filter/filter";
13
14
  import { FilterTags } from "../FilterTags/filterTags";
@@ -82,7 +83,12 @@ export const Filters = ({
82
83
  }, [windowHeight]);
83
84
 
84
85
  return (
85
- <FilterList disabled={disabled} height={height} ref={filterListRef}>
86
+ <FilterList
87
+ data-testid={TEST_IDS.FILTERS}
88
+ disabled={disabled}
89
+ height={height}
90
+ ref={filterListRef}
91
+ >
86
92
  {categoryFilters.map(({ categoryViews, label }, i) => (
87
93
  <Fragment key={i}>
88
94
  {i !== 0 && <Divider />}
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
+ import { TestIdProps } from "../../../types";
2
3
  import { FilterMenuSearchMatchRange } from "../../common/entities";
3
4
  import { MatchHighlight } from "./highlightedLabel.styles";
4
5
 
5
- interface HighlightedLabelProps {
6
+ interface HighlightedLabelProps extends TestIdProps {
6
7
  label: string;
7
8
  ranges?: FilterMenuSearchMatchRange[];
8
9
  }
@@ -10,6 +11,7 @@ interface HighlightedLabelProps {
10
11
  export const HighlightedLabel = ({
11
12
  label,
12
13
  ranges,
14
+ testId,
13
15
  }: HighlightedLabelProps): JSX.Element => {
14
16
  const items = [];
15
17
  if (ranges) {
@@ -40,5 +42,5 @@ export const HighlightedLabel = ({
40
42
  } else {
41
43
  items.push(label);
42
44
  }
43
- return <span>{items}</span>;
45
+ return <span data-testid={testId}>{items}</span>;
44
46
  };
@@ -7,6 +7,7 @@ import {
7
7
  } from "@mui/material";
8
8
  import React, { useEffect, useRef } from "react";
9
9
  import { OnFilterFn } from "../../../../../../hooks/useCategoryFilter";
10
+ import { TEST_IDS } from "../../../../../../tests/testIds";
10
11
  import { TEXT_BODY_SMALL_400 } from "../../../../../../theme/common/typography";
11
12
  import { CheckedIcon } from "../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
12
13
  import { UncheckedIcon } from "../../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
@@ -49,6 +50,7 @@ export default function VariableSizeListItem({
49
50
  } = item;
50
51
  return (
51
52
  <ListItemButton
53
+ data-testid={TEST_IDS.FILTER_ITEM}
52
54
  ref={setRef}
53
55
  key={key}
54
56
  onClick={(): void =>
@@ -64,9 +66,19 @@ export default function VariableSizeListItem({
64
66
  />
65
67
  <ListItemText
66
68
  disableTypography
67
- primary={<HighlightedLabel label={label} ranges={matchRanges} />}
69
+ primary={
70
+ <HighlightedLabel
71
+ label={label}
72
+ ranges={matchRanges}
73
+ testId={TEST_IDS.FILTER_TERM}
74
+ />
75
+ }
68
76
  secondary={
69
- <Typography color="ink.light" variant={TEXT_BODY_SMALL_400}>
77
+ <Typography
78
+ color="ink.light"
79
+ data-testid={TEST_IDS.FILTER_COUNT}
80
+ variant={TEXT_BODY_SMALL_400}
81
+ >
70
82
  {count}
71
83
  </Typography>
72
84
  }
@@ -17,6 +17,7 @@ import {
17
17
  useBreakpointHelper,
18
18
  } from "../../../../hooks/useBreakpointHelper";
19
19
  import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
20
+ import { TEST_IDS } from "../../../../tests/testIds";
20
21
  import { DESKTOP_SM } from "../../../../theme/common/breakpoints";
21
22
  import { SearchCloseButton } from "../SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton";
22
23
  import { SearchAllFiltersSearch } from "../SearchAllFiltersSearch/searchAllFiltersSearch";
@@ -154,6 +155,7 @@ export const SearchAllFilters = ({
154
155
  >
155
156
  <Autocomplete
156
157
  clearOnBlur={desktopSmUp}
158
+ data-testid={TEST_IDS.SEARCH_ALL_FILTERS}
157
159
  filterOptions={(options): string[] => options}
158
160
  freeSolo
159
161
  ListboxComponent={Listbox}
@@ -8,6 +8,7 @@ import React, { CSSProperties, useEffect, useRef } from "react";
8
8
  import { CategoryKey } from "../../../../common/entities";
9
9
  import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
10
10
  import { SELECT_CATEGORY_KEY } from "../../../../providers/exploreState/constants";
11
+ import { TEST_IDS } from "../../../../tests/testIds";
11
12
  import { TEXT_BODY_SMALL_400 } from "../../../../theme/common/typography";
12
13
  import { CheckedIcon } from "../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
13
14
  import { UncheckedIcon } from "../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
@@ -49,6 +50,7 @@ export default function VariableSizeListItem({
49
50
 
50
51
  return (
51
52
  <ListItemButton
53
+ data-testid={TEST_IDS.FILTER_ITEM}
52
54
  ref={listItemRef}
53
55
  onClick={handleItemClicked}
54
56
  selected={selected}
@@ -61,10 +63,20 @@ export default function VariableSizeListItem({
61
63
  />
62
64
  <ListItemText
63
65
  disableTypography
64
- primary={<HighlightedLabel label={label} ranges={labelRanges} />}
66
+ primary={
67
+ <HighlightedLabel
68
+ label={label}
69
+ ranges={labelRanges}
70
+ testId={TEST_IDS.FILTER_TERM}
71
+ />
72
+ }
65
73
  secondary={
66
74
  categoryKey !== SELECT_CATEGORY_KEY.SAVED_FILTERS && (
67
- <Typography color="ink.light" variant={TEXT_BODY_SMALL_400}>
75
+ <Typography
76
+ color="ink.light"
77
+ data-testid={TEST_IDS.FILTER_COUNT}
78
+ variant={TEXT_BODY_SMALL_400}
79
+ >
68
80
  {count}
69
81
  </Typography>
70
82
  )
@@ -1,5 +1,6 @@
1
1
  import { ToggleButton, ToggleButtonGroup, Toolbar } from "@mui/material";
2
2
  import React from "react";
3
+ import { TEST_IDS } from "../../../../tests/testIds";
3
4
  import { GridPaper } from "../../../common/Paper/paper.styles";
4
5
  import { StyledFluidPaper } from "./entitiesView.styles";
5
6
  import { VIEW_MODE } from "./hooks/UseEntitiesView/types";
@@ -8,12 +9,11 @@ import { EntitiesViewProps } from "./types";
8
9
  export const EntitiesView = ({
9
10
  children,
10
11
  onChange,
11
- testId,
12
12
  viewMode,
13
13
  viewStatus,
14
14
  }: EntitiesViewProps): JSX.Element => {
15
15
  return (
16
- <StyledFluidPaper testId={testId}>
16
+ <StyledFluidPaper testId={TEST_IDS.ENTITIES_VIEW}>
17
17
  <GridPaper>
18
18
  {viewStatus.disabled ? null : (
19
19
  <Toolbar>
@@ -1,8 +1,8 @@
1
1
  import { ToggleButtonGroupProps } from "@mui/material";
2
- import { ChildrenProps, TestIdProps } from "../../../types";
2
+ import { ChildrenProps } from "../../../types";
3
3
  import { VIEW_MODE, ViewStatus } from "./hooks/UseEntitiesView/types";
4
4
 
5
- export interface EntitiesViewProps extends ChildrenProps, TestIdProps {
5
+ export interface EntitiesViewProps extends ChildrenProps {
6
6
  onChange: ToggleButtonGroupProps["onChange"];
7
7
  viewMode: VIEW_MODE;
8
8
  viewStatus: ViewStatus;