Skip to content

Commit

Permalink
explorer: Update @testing-library/svelte to v5.x
Browse files Browse the repository at this point in the history
- Updated dependencies

Resolves #1845
  • Loading branch information
ascartabelli committed Jun 25, 2024
1 parent b32f533 commit 514c8fb
Show file tree
Hide file tree
Showing 34 changed files with 16,909 additions and 25,311 deletions.
251 changes: 165 additions & 86 deletions explorer/package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@
"devDependencies": {
"@dusk-network/eslint-config": "3.1.0",
"@dusk-network/prettier-config": "1.1.0",
"@sveltejs/adapter-static": "3.0.1",
"@sveltejs/kit": "2.5.10",
"@sveltejs/adapter-static": "3.0.2",
"@sveltejs/kit": "2.5.17",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/svelte": "4.1.0",
"@testing-library/svelte": "5.1.0",
"@types/d3-geo": "3.1.0",
"@types/node": "20.14.2",
"@types/node": "20.14.8",
"@vitest/browser": "1.6.0",
"@vitest/coverage-istanbul": "1.6.0",
"autoprefixer": "10.4.19",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-custom-alias": "1.3.2",
"eslint-plugin-svelte": "2.39.3",
"eslint-plugin-svelte": "2.41.0",
"jsdom": "24.1.0",
"jsdom-worker": "0.3.0",
"lamb-types": "0.61.7",
"postcss-nested": "6.0.1",
"prettier": "3.3.2",
"prettier-plugin-svelte": "3.2.4",
"prettier-plugin-svelte": "3.2.5",
"svelte": "4.2.18",
"svelte-check": "3.8.0",
"svelte-preprocess": "5.1.4",
"typescript": "5.4.5",
"svelte-check": "3.8.1",
"svelte-preprocess": "6.0.1",
"typescript": "5.5.2",
"vite": "5.2.13",
"vite-tsconfig-paths": "4.3.2",
"vitest": "1.6.0"
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/lib/components/__tests__/AppAnchorButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("AppAnchorButton", () => {

afterEach(cleanup);

it("should render an `AnchorButton` with the base path prepended to the `href` attribute, if the `href` represents an absolute URL", () => {
it("should render an `AnchorButton` with the base path prepended to the `href` attribute, if the `href` represents an absolute URL", async () => {
const { container, getByRole, rerender } = render(
AppAnchorButton,
baseProps
Expand All @@ -25,7 +25,7 @@ describe("AppAnchorButton", () => {
expect(anchorA).toHaveClass("foo bar");
expect(anchorA).toHaveAttribute("id", baseProps.id);

rerender({ ...baseProps, href: "/" });
await rerender({ ...baseProps, href: "/" });

const anchorB = getByRole("link");

Expand Down
4 changes: 2 additions & 2 deletions explorer/src/lib/components/__tests__/AppImage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("AppImage", () => {

afterEach(cleanup);

it("should render an HTML image forwarding all attributes but with the base path prepended to the `src` if it's an absolute URL", () => {
it("should render an HTML image forwarding all attributes but with the base path prepended to the `src` if it's an absolute URL", async () => {
const { container, getByRole, rerender } = render(AppImage, baseProps);
const imgA = getByRole("img");

Expand All @@ -26,7 +26,7 @@ describe("AppImage", () => {
expect(imgA).toHaveAttribute("src", `${base}${baseProps.src}`);
expect(imgA).toHaveAttribute("width", baseProps.width);

rerender({ ...baseProps, className: "baz", src: "/" });
await rerender({ ...baseProps, className: "baz", src: "/" });

const imgB = getByRole("img");

Expand Down
10 changes: 5 additions & 5 deletions explorer/src/lib/components/__tests__/AppSource.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("AppSource", () => {
src: "/images/some-image.jpg",
};

it("should render a source element forwarding all attributes but with the base path prepended to the `src` if it's an absolute URL", () => {
it("should render a source element forwarding all attributes but with the base path prepended to the `src` if it's an absolute URL", async () => {
const { container, rerender } = render(AppSource, baseProps);
const source = getSourceElementIn(container);

Expand All @@ -37,7 +37,7 @@ describe("AppSource", () => {

expect(source).toHaveAttribute("src", `${base}${baseProps.src}`);

rerender({ ...baseProps, src: "/" });
await rerender({ ...baseProps, src: "/" });

expect(getSourceElementIn(container)).toHaveAttribute("src", `${base}/`);
});
Expand All @@ -58,7 +58,7 @@ describe("AppSource", () => {
});

describe("srcset attribute", () => {
it("should render a source element forwarding all attributes but with the base path prepended to absolute URLs in the `srcset`", () => {
it("should render a source element forwarding all attributes but with the base path prepended to absolute URLs in the `srcset`", async () => {
const props = {
...commonProps,
srcset: "/images/some-image.jpg 1.5x",
Expand All @@ -74,14 +74,14 @@ describe("AppSource", () => {

expect(source).toHaveAttribute("srcset", `${base}${props.srcset}`);

rerender({ ...props, srcset: "/images/some-image.jpg" });
await rerender({ ...props, srcset: "/images/some-image.jpg" });

expect(getSourceElementIn(container)).toHaveAttribute(
"srcset",
`${base}/images/some-image.jpg`
);

rerender({ ...props, srcset: "/ 1.5x" });
await rerender({ ...props, srcset: "/ 1.5x" });

expect(getSourceElementIn(container)).toHaveAttribute(
"srcset",
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/lib/components/__tests__/BlockDetails.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ describe("Block Details", () => {
"true"
);

rerender(baseProps);
await rerender(baseProps);

expect(getBlockNavLink(container, "prev")).toHaveAttribute(
"aria-disabled",
"false"
);

rerender(setPathIn(baseProps, "data.header.height", 0));
await rerender(setPathIn(baseProps, "data.header.height", 0));

expect(getBlockNavLink(container, "prev")).toHaveAttribute(
"aria-disabled",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`AppAnchorButton > should render an \`AnchorButton\` with the base path prepended to the \`href\` attribute, if the \`href\` represents an absolute URL 1`] = `
<div>
<a
aria-disabled="false"
class="dusk-anchor dusk-anchor--on-surface dusk-anchor-button dusk-anchor-button--variant--primary dusk-anchor-button--size--normal foo bar"
href="/some-base-path/setup"
id="some-id"
>
</a>
</div>
<a
aria-disabled="false"
class="dusk-anchor dusk-anchor--on-surface dusk-anchor-button dusk-anchor-button--variant--primary dusk-anchor-button--size--normal foo bar"
href="/some-base-path/setup"
id="some-id"
>
</a>
`;
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`AppImage > should render an HTML image forwarding all attributes but with the base path prepended to the \`src\` if it's an absolute URL 1`] = `
<div>
<img
alt="Some alternative text"
class="foo bar"
height="600"
src="/some-base-path/images/some-image.jpg"
width="800"
/>
</div>
<img
alt="Some alternative text"
class="foo bar"
height="600"
src="/some-base-path/images/some-image.jpg"
width="800"
/>
`;
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`AppSource > src attribute > should render a source element forwarding all attributes but with the base path prepended to the \`src\` if it's an absolute URL 1`] = `
<div>
<source
data-foo="bar"
height="600"
src="/some-base-path/images/some-image.jpg"
type="image/jpeg"
width="800"
/>
</div>
<source
data-foo="bar"
height="600"
src="/some-base-path/images/some-image.jpg"
type="image/jpeg"
width="800"
/>
`;

exports[`AppSource > srcset attribute > should render a source element forwarding all attributes but with the base path prepended to absolute URLs in the \`srcset\` 1`] = `
<div>
<source
data-foo="bar"
height="600"
srcset="/some-base-path/images/some-image.jpg 1.5x"
type="image/jpeg"
width="800"
/>
</div>
<source
data-foo="bar"
height="600"
srcset="/some-base-path/images/some-image.jpg 1.5x"
type="image/jpeg"
width="800"
/>
`;
Loading

0 comments on commit 514c8fb

Please sign in to comment.