Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason next lint didn't pick up the .js configuration, but we don't actually need it anyway.

"extends": ["@inrupt/eslint-config-react", "plugin:@next/next/recommended"],

"rules": {
// temporarily disable this until we fix it everywhere
"no-shadow": 0,
// temporarily set this to warn this until we fix it everywhere
"no-unused-vars": 0,
"react/display-name": 0,
"react/forbid-prop-types": 0
}
}
32 changes: 0 additions & 32 deletions babel.config.js

This file was deleted.

18 changes: 0 additions & 18 deletions certificates/localhost.crt

This file was deleted.

28 changes: 0 additions & 28 deletions certificates/localhost.key

This file was deleted.

7 changes: 6 additions & 1 deletion clientid.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"@context":"https://www.w3.org/ns/solid/oidc-context.jsonld","client_id":"https://pod.inrupt.com/appsteamdev/clientid.json","redirect_uris":["https://localhost:3000/","https://localhost:3000/login"],"client_name":"Inrupt PodBrowser Localhost"}
{
"@context": "https://www.w3.org/ns/solid/oidc-context.jsonld",
"client_id": "https://pod.inrupt.com/appsteamdev/clientid.json",
"redirect_uris": ["http://localhost:3000/", "http://localhost:3000/login"],
"client_name": "Inrupt PodBrowser Localhost"
}
4 changes: 2 additions & 2 deletions components/agentResourceAccessLink/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ describe("AgentResourceAccessLink", () => {

describe("buildProfileLink", () => {
it("generates a valid path for person", () => {
expect(buildResourcesLink(iri, "/privacy", "person")).toEqual(
expect(buildResourcesLink(iri, "/privacy", "person")).toBe(
`/privacy/person/${encodeURIComponent(iri)}`
);
});
it("generates a valid path for app", () => {
expect(buildResourcesLink(iri, "/privacy", "app")).toEqual(
expect(buildResourcesLink(iri, "/privacy", "app")).toBe(
`/privacy/app/${encodeURIComponent(iri)}`
);
});
Expand Down
8 changes: 4 additions & 4 deletions components/bookmark/bookmarkText/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ describe("BookmarkText", () => {
test("it renders default add string when no addText is passed", async () => {
renderWithTheme(<BookmarkText />);
const text = screen.getByTestId("bookmark-text");
expect(text.textContent).toEqual("Add Bookmark");
expect(text.textContent).toBe("Add Bookmark");
});
test("it renders default remove string when no removeText is passed", async () => {
renderWithTheme(<BookmarkText bookmarked />);
const text = screen.getByTestId("bookmark-text");
expect(text.textContent).toEqual("Remove Bookmark");
expect(text.textContent).toBe("Remove Bookmark");
});
test("it renders passed addText when available", async () => {
renderWithTheme(<BookmarkText addText="Bookmark Pod" />);
const text = screen.getByTestId("bookmark-text");
expect(text.textContent).toEqual("Bookmark Pod");
expect(text.textContent).toBe("Bookmark Pod");
});
test("it renders passed removeText when available", async () => {
renderWithTheme(
<BookmarkText bookmarked removeText="Remove Pod Bookmark" />
);
const text = screen.getByTestId("bookmark-text");
expect(text.textContent).toEqual("Remove Pod Bookmark");
expect(text.textContent).toBe("Remove Pod Bookmark");
});
});
16 changes: 8 additions & 8 deletions components/bookmark/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const setBookmarks = jest.fn();
describe("Bookmark", () => {
test("it renders a bookmark icon", async () => {
const { asFragment } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VirginiaBalseiro this may have been causing test bugs

<Bookmark iri={iri} />
</BookmarkContext.Provider>
);
Expand All @@ -44,7 +44,7 @@ describe("Bookmark", () => {

test("it renders a bookmark icon and text if withText prop is true", async () => {
const { asFragment, getByTestId } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} withText />
</BookmarkContext.Provider>
);
Expand All @@ -55,7 +55,7 @@ describe("Bookmark", () => {

test("it renders default text if add and remove strings are not passed", async () => {
const { getByText } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} withText />
</BookmarkContext.Provider>
);
Expand All @@ -64,7 +64,7 @@ describe("Bookmark", () => {
});
test("it renders passed strings for add and remove if available", async () => {
const { getByText } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark
iri={iri}
withText
Expand All @@ -79,7 +79,7 @@ describe("Bookmark", () => {

test("it renders a button if menuItem is false", async () => {
const { asFragment, getByTestId } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} />
</BookmarkContext.Provider>
);
Expand All @@ -90,7 +90,7 @@ describe("Bookmark", () => {

test("it renders a list item button if menuItem is true", async () => {
const { asFragment, getByTestId } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} menuItem />
</BookmarkContext.Provider>
);
Expand All @@ -103,7 +103,7 @@ describe("Bookmark", () => {
describe("toggleHandler", () => {
test("it updates icon when the toggle handler is triggered", async () => {
const { container } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} />
</BookmarkContext.Provider>
);
Expand Down Expand Up @@ -163,7 +163,7 @@ describe("toggleHandler", () => {
});
test("it renders an error when it is unsuccessful in adding bookmark", async () => {
const { container } = renderWithTheme(
<BookmarkContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarkContext.Provider value={{ bookmarks, setBookmarks }}>
<Bookmark iri={iri} />
</BookmarkContext.Provider>
);
Expand Down
6 changes: 3 additions & 3 deletions components/contactsList/contactsListSearch/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ describe("setupFilterOptions", () => {
describe("setupGetOptionLabel", () => {
it("calls a function", () => {
const getOptionLabel = setupGetOptionLabel();
expect(getOptionLabel()).toEqual("");
expect(getOptionLabel("test")).toEqual("test");
expect(getOptionLabel({ name: "Alice" })).toEqual("Alice");
expect(getOptionLabel()).toBe("");
expect(getOptionLabel("test")).toBe("test");
expect(getOptionLabel({ name: "Alice" })).toBe("Alice");
});
});
2 changes: 1 addition & 1 deletion components/contactsList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function ContactsList() {
<PageHeader
title="Contacts"
actions={[
<Link href="/contacts/add">
<Link key="add-contact" href="/contacts/add">
<a className={actionClass}>Add new contact</a>
</Link>,
]}
Expand Down
10 changes: 5 additions & 5 deletions components/containerTableRow/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("ContainerTableRow", () => {
const { asFragment } = renderWithTheme(
<table>
<tbody>
<BookmarksContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarksContext.Provider value={{ bookmarks, setBookmarks }}>
<ContainerTableRow
resource={resource}
container="https://example.com/container/"
Expand All @@ -84,7 +84,7 @@ describe("ContainerTableRow", () => {
const { asFragment } = renderWithTheme(
<table>
<tbody>
<BookmarksContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarksContext.Provider value={{ bookmarks, setBookmarks }}>
<ContainerTableRow
resource={resource}
container="https://example.com/container/"
Expand All @@ -107,7 +107,7 @@ describe("ContainerTableRow", () => {
const { asFragment } = renderWithTheme(
<table>
<tbody>
<BookmarksContext.Provider value={(bookmarks, setBookmarks)}>
<BookmarksContext.Provider value={{ bookmarks, setBookmarks }}>
<ContainerTableRow
resource={resource}
container="https://example.com/container/"
Expand Down Expand Up @@ -200,10 +200,10 @@ describe("ResourceIcon", () => {

describe("renderResourceType", () => {
test("it renders Container with a container iri", () => {
expect(renderResourceType("/container/")).toEqual("Container");
expect(renderResourceType("/container/")).toBe("Container");
});

test("it renders Resource with a resource iri", () => {
expect(renderResourceType("/resource")).toEqual("Resource");
expect(renderResourceType("/resource")).toBe("Resource");
});
});
4 changes: 2 additions & 2 deletions components/downloadLink/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ describe("forceDownload", () => {

forceDownload("filename", file);

expect(mockAnchor.style.display).toEqual("none");
expect(mockAnchor.href).toEqual("object-url");
expect(mockAnchor.style.display).toBe("none");
expect(mockAnchor.href).toBe("object-url");
expect(setAttributeMock).toHaveBeenCalledWith("download", "filename");
expect(appendChildMock).toHaveBeenCalledWith(mockAnchor);
expect(clickMock).toHaveBeenCalled();
Expand Down
16 changes: 8 additions & 8 deletions components/login/provider/validateProviderIri.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("validateProviderIri", () => {
accept: "application/json",
});

expect(result.error).not.toBeDefined();
expect(result.error).toBeUndefined();
expect(result.issuer).toBe(VALID_ISSUER);
});

Expand All @@ -75,7 +75,7 @@ describe("validateProviderIri", () => {
const result = await validateProviderIri("http://openid.provider.com/");

expect(result.error).toBe("network_error");
expect(result.issuer).not.toBeDefined();
expect(result.issuer).toBeUndefined();
});

it("should handle json errors", async () => {
Expand All @@ -84,7 +84,7 @@ describe("validateProviderIri", () => {
const result = await validateProviderIri("http://openid.provider.com/");

expect(result.error).toBe("invalid_url");
expect(result.issuer).not.toBeDefined();
expect(result.issuer).toBeUndefined();
});

it("should handle json not containing the issuer key", async () => {
Expand All @@ -93,7 +93,7 @@ describe("validateProviderIri", () => {
const result = await validateProviderIri("http://openid.provider.com/");

expect(result.error).toBe("invalid_url");
expect(result.issuer).not.toBeDefined();
expect(result.issuer).toBeUndefined();
});

it("should handle 4xx errors", async () => {
Expand All @@ -102,7 +102,7 @@ describe("validateProviderIri", () => {
const result = await validateProviderIri("http://openid.provider.com/");

expect(result.error).toBe("bad_request");
expect(result.issuer).not.toBeDefined();
expect(result.issuer).toBeUndefined();
});

it("should handle 5xx errors", async () => {
Expand All @@ -111,7 +111,7 @@ describe("validateProviderIri", () => {
const result = await validateProviderIri("http://openid.provider.com/");

expect(result.error).toBe("unavailable");
expect(result.issuer).not.toBeDefined();
expect(result.issuer).toBeUndefined();
});

it("should return the issuer from the openid configuration, not the provider passed in", async () => {
Expand All @@ -125,7 +125,7 @@ describe("validateProviderIri", () => {
expect.anything()
);

expect(result.error).not.toBeDefined();
expect(result.error).toBeUndefined();
expect(result.issuer).toBe(expectedIssuer);
});

Expand All @@ -139,6 +139,6 @@ describe("validateProviderIri", () => {
expect.anything()
);

expect(result.error).not.toBeDefined();
expect(result.error).toBeUndefined();
});
});
2 changes: 1 addition & 1 deletion components/noControlWarning/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ describe("setupOnClose", () => {
const event = { preventDefault: jest.fn() };
expect(setupOnClose()(event)).toBeUndefined();
expect(event.preventDefault).toHaveBeenCalledWith();
expect(sessionStorage.getItem("no-control-warning-closed")).toEqual("true");
expect(sessionStorage.getItem("no-control-warning-closed")).toBe("true");
});
});
Loading