@agilant/toga-blox 1.0.77 → 1.0.80
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.
|
@@ -24,6 +24,7 @@ const MultiSelectInput = ({ id, name, options = [], selectedValue = [], onChange
|
|
|
24
24
|
}
|
|
25
25
|
// If user selected ALL possible options, show "All items selected"
|
|
26
26
|
if (selected.length === multiSelectOptions.length) {
|
|
27
|
+
``;
|
|
27
28
|
return "All items selected";
|
|
28
29
|
}
|
|
29
30
|
// Default behavior: comma-separated labels
|
|
@@ -477,10 +477,13 @@ describe("SearchInput Component", () => {
|
|
|
477
477
|
});
|
|
478
478
|
test("renders selectedStartDate if provided, otherwise shows default text", () => {
|
|
479
479
|
const mockStartDate = new Date(2023, 5, 15); // June 15, 2023
|
|
480
|
+
// Helper to format date as YYYY-MM-DD
|
|
481
|
+
const formatDate = (date) => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
480
482
|
const { rerender } = render(_jsx(SearchInput, { column: undefined, setSearchCriteria: undefined, ...defaultProps, inputType: "date", toggleStatus: true, selectedStartDate: null }));
|
|
481
483
|
expect(screen.getByText("Start Date")).toBeInTheDocument();
|
|
482
484
|
rerender(_jsx(SearchInput, { column: undefined, setSearchCriteria: undefined, ...defaultProps, inputType: "date", toggleStatus: true, selectedStartDate: mockStartDate }));
|
|
483
|
-
|
|
485
|
+
// Use the formatted date string
|
|
486
|
+
expect(screen.getByText(formatDate(mockStartDate))).toBeInTheDocument();
|
|
484
487
|
});
|
|
485
488
|
test("calls onStartDateSelect when a start date is selected", () => {
|
|
486
489
|
render(_jsx(SearchInput, { column: undefined, setSearchCriteria: undefined, ...defaultProps, inputType: "date", toggleStatus: true }));
|
|
@@ -51,7 +51,6 @@ searchItems = [], setSearchItems, handleFilter, setSearchCriteria, column, setEd
|
|
|
51
51
|
const parsed = JSON.parse(stored);
|
|
52
52
|
const existing = parsed.find((criterion) => criterion.searchColumn.id === column.id);
|
|
53
53
|
if (existing && setSearchItems) {
|
|
54
|
-
// e.g. "2025-02-27" or "2024-12-01 - 2024-12-28"
|
|
55
54
|
setSearchItems([existing.submittedSearchText]);
|
|
56
55
|
}
|
|
57
56
|
}
|