@truedat/core 7.14.1 → 7.14.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/core",
3
- "version": "7.14.1",
3
+ "version": "7.14.3",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -48,7 +48,7 @@
48
48
  "@testing-library/jest-dom": "^6.6.3",
49
49
  "@testing-library/react": "^16.3.0",
50
50
  "@testing-library/user-event": "^14.6.1",
51
- "@truedat/test": "7.14.1",
51
+ "@truedat/test": "7.14.3",
52
52
  "identity-obj-proxy": "^3.0.0",
53
53
  "jest": "^29.7.0",
54
54
  "redux-saga-test-plan": "^4.0.6"
@@ -85,5 +85,5 @@
85
85
  "slate-react": "^0.22.10",
86
86
  "swr": "^2.3.3"
87
87
  },
88
- "gitHead": "afc55f553bb99ed37bfcc85fc83ba815d48b4769"
88
+ "gitHead": "f8b2f517aa25cf1eab47a89b17e0b08dfe6c8a26"
89
89
  }
@@ -225,9 +225,11 @@ export const SearchContextProvider = (props) => {
225
225
  ...(!_.isEmpty(query) && { query }),
226
226
  must: getMustFilters(filterMust),
227
227
  must_not: getMustNotFilters(filterMust),
228
+ ...enrichSearchPayload,
228
229
  };
230
+ console.log("filterParam", filterParam);
229
231
  debouncedTriggerSearchFilters(filterParam);
230
- }, [query, filterMust]);
232
+ }, [query, filterMust, enrichSearchPayload]);
231
233
 
232
234
  const { trigger: triggerSearch } = useSearch();
233
235
 
@@ -72,4 +72,34 @@ describe("<SearchContextProvider />", () => {
72
72
  await findByText(/Child Component/);
73
73
  expect(container).toMatchSnapshot();
74
74
  });
75
+ it("passes enrichSearchPayload to filters trigger", async () => {
76
+ jest.useFakeTimers();
77
+ const triggerFiltersSpy = jest.fn().mockReturnValue({
78
+ then: (callback) => callback({ data: [] }),
79
+ });
80
+ const useFiltersSpy = () => ({ trigger: triggerFiltersSpy });
81
+
82
+ const enrichSearchPayload = { link_structures: true };
83
+ const props = {
84
+ ...searchProps,
85
+ useFilters: useFiltersSpy,
86
+ enrichSearchPayload,
87
+ };
88
+
89
+ render(
90
+ <SearchContextProvider {...props}>
91
+ <ChildComponent />
92
+ </SearchContextProvider>,
93
+ renderOpts
94
+ );
95
+
96
+ jest.runAllTimers();
97
+
98
+ expect(triggerFiltersSpy).toHaveBeenCalledWith(
99
+ expect.objectContaining({
100
+ link_structures: true,
101
+ })
102
+ );
103
+ jest.useRealTimers();
104
+ });
75
105
  });