@agilant/toga-blox 1.0.77 → 1.0.79
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.
|
@@ -27,7 +27,7 @@ const MultiSelectInput = ({ id, name, options = [], selectedValue = [], onChange
|
|
|
27
27
|
return "All items selected";
|
|
28
28
|
}
|
|
29
29
|
// Default behavior: comma-separated labels
|
|
30
|
-
return selected.map((s) => s.label).join("
|
|
30
|
+
return selected.map((s) => s.label).join("; ");
|
|
31
31
|
};
|
|
32
32
|
return (_jsx("div", { className: `${width}`, children: _jsx(MultiSelect, { id: id, name: name, className: className, options: multiSelectOptions, value: multiSelectValue, onChange: (selectedOptions) => {
|
|
33
33
|
// Convert back to OptionType when passing to onChange
|
|
@@ -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
|
}
|