({
export interface ISessionProvider {
children: ReactNode;
sessionId?: string;
- session?: Session;
sessionRequestInProgress?: boolean;
onError?: (error: Error) => void;
/** @since 2.3.0 */
diff --git a/src/context/thingContext/index.test.tsx b/src/context/thingContext/index.test.tsx
index cf6d963b..1ad9b0c2 100644
--- a/src/context/thingContext/index.test.tsx
+++ b/src/context/thingContext/index.test.tsx
@@ -23,7 +23,7 @@
import * as React from "react";
import { RenderResult, render } from "@testing-library/react";
import * as SolidFns from "@inrupt/solid-client";
-import ThingContext, { ThingProvider } from "./index";
+import ThingContext, { ThingProvider } from ".";
import { DatasetProvider } from "../datasetContext";
let documentBody: RenderResult;
diff --git a/src/helpers/index.test.tsx b/src/helpers/index.test.tsx
index a2cf41b9..c8eaed7b 100644
--- a/src/helpers/index.test.tsx
+++ b/src/helpers/index.test.tsx
@@ -25,7 +25,7 @@ import {
DataType,
getPropertyForThing,
getValueByType,
-} from "./index";
+} from ".";
describe("getValueByTypeAll", () => {
it.each([
diff --git a/src/hooks/useDataset/index.test.tsx b/src/hooks/useDataset/index.test.tsx
index 292af9f9..0a6fa5bd 100644
--- a/src/hooks/useDataset/index.test.tsx
+++ b/src/hooks/useDataset/index.test.tsx
@@ -21,7 +21,7 @@
import * as React from "react";
import { renderHook } from "@testing-library/react-hooks";
-import { SWRConfig, cache } from "swr";
+import { SWRConfig } from "swr";
import * as SolidFns from "@inrupt/solid-client";
import { Session } from "@inrupt/solid-client-authn-browser";
import DatasetContext from "../../context/datasetContext";
@@ -35,32 +35,35 @@ describe("useDataset() hook", () => {
const mockGetSolidDataset = jest
.spyOn(SolidFns, "getSolidDataset")
.mockResolvedValue(mockDataset);
+
const mockFetch = jest.fn();
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
- {},
- login: async () => {},
- profile: undefined,
- }}
- >
- new Map() }}>
+ {},
+ fetch: mockFetch,
+ sessionRequestInProgress: true,
+ session: {} as Session,
+ logout: async () => {},
+ login: async () => {},
+ profile: undefined,
}}
>
- {children}
-
-
+ {},
+ }}
+ >
+ {children}
+
+
+
);
afterEach(() => {
jest.clearAllMocks();
- cache.clear();
});
it("should call getSolidDataset with given Iri", async () => {
diff --git a/src/hooks/useSession/index.test.tsx b/src/hooks/useSession/index.test.tsx
index d38ca184..6f0b6fde 100644
--- a/src/hooks/useSession/index.test.tsx
+++ b/src/hooks/useSession/index.test.tsx
@@ -23,7 +23,7 @@ import * as React from "react";
import { renderHook } from "@testing-library/react-hooks";
import { Session } from "@inrupt/solid-client-authn-browser";
import { SessionContext } from "../../context/sessionContext";
-import useSession from "./index";
+import useSession from ".";
describe("useSession() hook functional testing", () => {
it("The hook should return values set in the SessionContext", async () => {
diff --git a/src/types/react-table-config.d.ts b/src/types/react-table-config.d.ts
index aafec7ef..75cf094f 100644
--- a/src/types/react-table-config.d.ts
+++ b/src/types/react-table-config.d.ts
@@ -1,5 +1,4 @@
-/* eslint-disable license-header/header */
-
+/* eslint-disable header/header */
/**
* This file is needed to provide correct types when using plugins such as sorting, filtering etc.
* Taken from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table#example-type-file
diff --git a/stories/authentication/sessionProvider.stories.tsx b/stories/authentication/sessionProvider.stories.tsx
index a171a5a2..85478490 100644
--- a/stories/authentication/sessionProvider.stories.tsx
+++ b/stories/authentication/sessionProvider.stories.tsx
@@ -68,6 +68,34 @@ export default {
},
};
+function Dashboard(): ReactElement {
+ const { session, sessionRequestInProgress } = useContext(SessionContext);
+
+ const sessionRequestText = sessionRequestInProgress
+ ? "Session request is in progress"
+ : "No session request is in progress";
+
+ return (
+
+
Current Session:
+ {session.info.webId || "logged out"}
+
+ Session Request:
+ {sessionRequestText}
+
+ {session.info.webId ? (
+
+ Profile name:
+
+
+ ) : null}
+
+ );
+}
+
export function ProviderWithHook(): ReactElement {
const [idp, setIdp] = useState("https://inrupt.net");
@@ -107,31 +135,3 @@ ProviderWithHook.parameters = {
actions: { disable: true },
controls: { disable: true },
};
-
-function Dashboard(): ReactElement {
- const { session, sessionRequestInProgress } = useContext(SessionContext);
-
- const sessionRequestText = sessionRequestInProgress
- ? "Session request is in progress"
- : "No session request is in progress";
-
- return (
-
-
Current Session:
- {session.info.webId || "logged out"}
-
- Session Request:
- {sessionRequestText}
-
- {session.info.webId ? (
-
- Profile name:
-
-
- ) : null}
-
- );
-}
diff --git a/stories/components/text.stories.tsx b/stories/components/text.stories.tsx
index 42cc3563..cd074813 100644
--- a/stories/components/text.stories.tsx
+++ b/stories/components/text.stories.tsx
@@ -19,6 +19,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* eslint-disable @typescript-eslint/no-explicit-any */
import React, { ReactElement } from "react";
import * as SolidFns from "@inrupt/solid-client";
import { Text } from "../../src/components/text";
diff --git a/stories/components/value.stories.tsx b/stories/components/value.stories.tsx
index ed644708..64c5bc0f 100644
--- a/stories/components/value.stories.tsx
+++ b/stories/components/value.stories.tsx
@@ -19,6 +19,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* eslint-disable @typescript-eslint/no-explicit-any */
import React, { ReactElement } from "react";
import * as SolidFns from "@inrupt/solid-client";
import { DataType } from "../../src/helpers";
diff --git a/webpack.config.js b/webpack.config.js
index 05f5975f..e3cd1d61 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -24,6 +24,7 @@ module.exports = {
filename: "index.js",
libraryTarget: "umd",
globalObject: "this",
+ path: path.resolve("./dist/")
},
plugins: [
new CleanWebpackPlugin(),