@scm-manager/ui-api 2.31.2-20220124-111117 → 2.31.2-20220202-090920

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": "@scm-manager/ui-api",
3
- "version": "2.31.2-20220124-111117",
3
+ "version": "2.31.2-20220202-090920",
4
4
  "description": "React hook api for the SCM-Manager backend",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "react-test-renderer": "^17.0.1"
26
26
  },
27
27
  "dependencies": {
28
- "@scm-manager/ui-types": "^2.31.2-20220124-111117",
28
+ "@scm-manager/ui-types": "^2.31.2-20220202-090920",
29
29
  "fetch-mock-jest": "^1.5.1",
30
30
  "gitdiff-parser": "^0.1.2",
31
31
  "query-string": "6.14.1",
@@ -23,18 +23,24 @@
23
23
  */
24
24
 
25
25
  import { LegacyContext, LegacyContextProvider, useLegacyContext } from "./LegacyContext";
26
- import { FC } from "react";
27
26
  import * as React from "react";
27
+ import { FC } from "react";
28
28
  import { renderHook } from "@testing-library/react-hooks";
29
+ import { QueryClient, QueryClientProvider } from "react-query";
29
30
 
30
31
  describe("LegacyContext tests", () => {
32
+ const queryClient = new QueryClient();
31
33
  const createWrapper = (context?: LegacyContext): FC => {
32
- return ({ children }) => <LegacyContextProvider {...context}>{children}</LegacyContextProvider>;
34
+ return ({ children }) => (
35
+ <QueryClientProvider client={queryClient}>
36
+ <LegacyContextProvider {...context}>{children}</LegacyContextProvider>
37
+ </QueryClientProvider>
38
+ );
33
39
  };
34
40
 
35
41
  it("should return provided context", () => {
36
42
  const { result } = renderHook(() => useLegacyContext(), {
37
- wrapper: createWrapper(),
43
+ wrapper: createWrapper()
38
44
  });
39
45
  expect(result.current).toBeDefined();
40
46
  });
@@ -33,6 +33,7 @@ export type BaseContext = {
33
33
 
34
34
  export type LegacyContext = BaseContext & {
35
35
  initialize: () => void;
36
+ queryClient?: QueryClient;
36
37
  };
37
38
 
38
39
  const Context = createContext<LegacyContext | undefined>(undefined);