Skip to content
Merged
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
8,451 changes: 3,692 additions & 4,759 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
},
"type": "module",
"version": "1.5.0",
"overrides": {
"cookie": "0.7.2"
},
"dependencies": {
"@floating-ui/dom": "1.7.5",
"@mdi/js": "7.4.47",
Expand All @@ -47,32 +50,32 @@
"@eslint/js": "9.39.2",
"@juggle/resize-observer": "3.4.0",
"@sveltejs/adapter-static": "3.0.10",
"@sveltejs/kit": "2.50.2",
"@sveltejs/vite-plugin-svelte": "3.1.2",
"@sveltejs/kit": "2.52.0",
"@sveltejs/vite-plugin-svelte": "6.2.4",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/svelte": "5.3.1",
"@types/d3-geo": "3.1.0",
"@types/node": "25.2.0",
"@types/node": "25.2.3",
"@vitest/browser": "4.0.18",
"@vitest/coverage-istanbul": "4.0.18",
"autoprefixer": "10.4.24",
"eslint": "9.39.2",
"eslint-config-prettier": "10.1.8",
"eslint-import-resolver-typescript": "4.4.4",
"eslint-plugin-svelte": "3.14.0",
"eslint-plugin-svelte": "3.15.0",
"globals": "17.3.0",
"jsdom": "28.0.0",
"jsdom": "28.1.0",
"jsdom-worker": "0.3.0",
"lamb-types": "0.61.16",
"postcss-nested": "7.0.2",
"prettier": "3.8.1",
"prettier-plugin-svelte": "3.4.1",
"svelte": "4.2.20",
"svelte-check": "4.3.6",
"svelte": "5.51.2",
"svelte-check": "4.4.0",
"svelte-preprocess": "6.0.3",
"typescript": "5.9.3",
"vite": "5.4.21",
"vite-tsconfig-paths": "6.0.5",
"vite": "7.3.1",
"vite-tsconfig-paths": "6.1.1",
"vitest": "4.0.18"
}
}
10 changes: 4 additions & 6 deletions src/lib/components/__tests__/AppAnchor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("AppAnchor", () => {
const renderA = renderWithSimpleContent(AppAnchor, baseOptions);
const anchorA = renderA.getByRole("link");

expect(renderA.container.firstChild).toMatchSnapshot();
expect(renderA.container.firstElementChild).toMatchSnapshot();
expect(anchorA).toHaveAttribute("href", `${base}${baseProps.href}`);
expect(anchorA).toHaveClass("foo bar");
expect(anchorA).toHaveAttribute("id", baseProps.id);
Expand Down Expand Up @@ -62,13 +62,11 @@ describe("AppAnchor", () => {

it("should forward the `onclick` event to the `Anchor`", async () => {
const handler = vi.fn();
const { component, getByRole } = render(AppAnchor, {
...baseProps,
href: "#",
const { getByRole } = render(AppAnchor, {
events: { click: handler },
props: { ...baseProps, href: "#" },
});

component.$on("click", handler);

await fireEvent.click(getByRole("link"));

expect(handler).toHaveBeenCalledTimes(1);
Expand Down
10 changes: 4 additions & 6 deletions src/lib/components/__tests__/AppAnchorButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("AppAnchorButton", () => {
);
const anchorA = getByRole("link");

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
expect(anchorA).toHaveAttribute("href", `${base}${baseProps.href}`);
expect(anchorA).toHaveClass("foo bar");
expect(anchorA).toHaveAttribute("id", baseProps.id);
Expand Down Expand Up @@ -52,13 +52,11 @@ describe("AppAnchorButton", () => {

it("should forward the `onclick` event to the `AnchorButton`", async () => {
const handler = vi.fn();
const { component, getByRole } = render(AppAnchorButton, {
...baseProps,
href: "#",
const { getByRole } = render(AppAnchorButton, {
events: { click: handler },
props: { ...baseProps, href: "#" },
});

component.$on("click", handler);

await fireEvent.click(getByRole("link"));

expect(handler).toHaveBeenCalledTimes(1);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/AppImage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("AppImage", () => {
const { container, getByRole, rerender } = render(AppImage, baseProps);
const imgA = getByRole("img");

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
expect(imgA).toHaveAttribute("alt", baseProps.alt);
expect(imgA).toHaveClass("foo bar");
expect(imgA).toHaveAttribute("height", baseProps.height);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/__tests__/AppSource.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("AppSource", () => {
const { container, rerender } = render(AppSource, baseProps);
const source = getSourceElementIn(container);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();

ownPairs(commonProps).forEach(([key, value]) => {
expect(source).toHaveAttribute(key, value);
Expand Down Expand Up @@ -66,7 +66,7 @@ describe("AppSource", () => {
const { container, rerender } = render(AppSource, props);
const source = getSourceElementIn(container);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();

ownPairs(commonProps).forEach(([key, value]) => {
expect(source).toHaveAttribute(key, value);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/__tests__/BlockDetails.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("Block Details", () => {
it("renders the Block Details component", () => {
const { container } = render(BlockDetails, baseProps);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should disable the previous block link if the prev block hash is empty or if the current height is `0`", async () => {
Expand Down Expand Up @@ -84,6 +84,6 @@ describe("Block Details", () => {

await fireEvent.click(getByRole("switch"));

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
8 changes: 4 additions & 4 deletions src/lib/components/__tests__/BlocksCard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("Blocks Card", () => {
it("should render the `BlocksCard` component", () => {
const { container } = render(BlocksCard, baseOptions);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should disable the `Show More` button is the card is in the loading state", () => {
Expand All @@ -46,7 +46,7 @@ describe("Blocks Card", () => {

expect(getByRole("button", { name: "Show More" })).toBeDisabled();

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should disable the `Show More` button if there is no more data to display", async () => {
Expand All @@ -60,7 +60,7 @@ describe("Blocks Card", () => {

expect(getByRole("button", { name: "Show More" })).toBeDisabled();

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should hide the `Show More` button if an error has occurred", async () => {
Expand All @@ -71,6 +71,6 @@ describe("Blocks Card", () => {
props: { ...props, error: new Error("error") },
});

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
18 changes: 12 additions & 6 deletions src/lib/components/__tests__/BlocksList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Blocks List", () => {
it("renders the Blocks List component", () => {
const { container } = render(BlocksList, baseProps);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should auto-refresh relative times when the related prop is set to true", async () => {
Expand All @@ -43,22 +43,28 @@ describe("Blocks List", () => {
const { container, rerender } = render(BlocksList, props);
const timeElement = getTimeElement(container);

expect(timeElement.innerHTML).toMatchInlineSnapshot(`"now"`);
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"<!---->now<!---->"`);

await vi.advanceTimersByTimeAsync(timeRefreshInterval * 3);

expect(timeElement.innerHTML).toMatchInlineSnapshot(`"now"`);
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"<!---->now<!---->"`);

await rerender({ ...props, autoRefreshTime: true });

expect(timeElement.innerHTML).toMatchInlineSnapshot(`"3 seconds ago"`);
expect(timeElement.innerHTML).toMatchInlineSnapshot(
`"<!----><!----><!---->3 seconds ago<!---->"`
);

await vi.advanceTimersByTimeAsync(timeRefreshInterval);

expect(timeElement.innerHTML).toMatchInlineSnapshot(`"4 seconds ago"`);
expect(timeElement.innerHTML).toMatchInlineSnapshot(
`"<!----><!----><!---->4 seconds ago<!---->"`
);

await vi.advanceTimersByTimeAsync(timeRefreshInterval);

expect(timeElement.innerHTML).toMatchInlineSnapshot(`"5 seconds ago"`);
expect(timeElement.innerHTML).toMatchInlineSnapshot(
`"<!----><!----><!---->5 seconds ago<!---->"`
);
});
});
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/BlocksTable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ describe("Blocks Table", () => {
it("should render the `BlocksTable` component", () => {
const { container } = render(BlocksTable, baseOptions);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
9 changes: 4 additions & 5 deletions src/lib/components/__tests__/DataAlert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("DataAlert", () => {
it("should render the `DataAlert` in the no data state", () => {
const { container } = render(DataAlert, baseOptions);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataAlert` in the error state", () => {
Expand All @@ -27,18 +27,17 @@ describe("DataAlert", () => {
props: { ...baseProps, error },
});

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should dispatch the `retry` event on button click", async () => {
const eventHandler = vi.fn();
const error = new Error("error");
const { component, getByRole } = render(DataAlert, {
...baseOptions,
const { getByRole } = render(DataAlert, {
events: { retry: eventHandler },
props: { ...baseProps, error },
});

component.$on("retry", eventHandler);
await fireEvent.click(getByRole("button"));
expect(eventHandler).toHaveBeenCalledTimes(1);
});
Expand Down
12 changes: 6 additions & 6 deletions src/lib/components/__tests__/DataCard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("DataCard", () => {
props: { ...baseProps, loading },
});

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataCard` in the error state", () => {
Expand All @@ -37,7 +37,7 @@ describe("DataCard", () => {
props: { ...baseProps, error },
});

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataCard` in the no data state", () => {
Expand All @@ -47,7 +47,7 @@ describe("DataCard", () => {
props: { ...baseProps, data },
});

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataCard` in the data state", () => {
Expand All @@ -57,7 +57,7 @@ describe("DataCard", () => {
props: { ...baseProps, data },
});

expect(renderWithSlots.container.firstChild).toMatchSnapshot();
expect(renderWithSlots.container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataCard` in the data state when loading is true", () => {
Expand All @@ -68,7 +68,7 @@ describe("DataCard", () => {
props: { ...baseProps, data, loading },
});

expect(renderWithSlots.container.firstChild).toMatchSnapshot();
expect(renderWithSlots.container.firstElementChild).toMatchSnapshot();
});

it("should pass the correct function to the button on click event", async () => {
Expand Down Expand Up @@ -100,6 +100,6 @@ describe("DataCard", () => {
});

expect(getByRole("button")).toBeDisabled();
expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
4 changes: 2 additions & 2 deletions src/lib/components/__tests__/DataGuard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("DataGuard", () => {
it("should render the `DataGuard` with the placeholder if no data is passed", () => {
const { container } = render(DataGuard, baseOptions);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should render the `DataGuard` if data is present", () => {
Expand All @@ -29,6 +29,6 @@ describe("DataGuard", () => {
props: { ...baseProps, data },
});

expect(renderWithSlots.container.firstChild).toMatchSnapshot();
expect(renderWithSlots.container.firstElementChild).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/DetailList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe("Detail List", () => {
it("renders the Detail List component", () => {
const render = renderWithSimpleContent(DetailList, baseOptions);

expect(render.container.firstChild).toMatchSnapshot();
expect(render.container.firstElementChild).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/Footer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe("Footer", () => {
it("renders the Footer component", () => {
const { container } = render(Footer);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/ListItem.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ describe("List Item", () => {
it("renders the List Item component", () => {
const { container } = render(ListItem, baseProps);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion src/lib/components/__tests__/Navbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Navbar", () => {
it("renders the Navbar component", () => {
const { container } = render(Navbar);

expect(container.firstChild).toMatchSnapshot();
expect(container.firstElementChild).toMatchSnapshot();
});

it("should hide the mobile menu after a navigation event", async () => {
Expand Down
Loading