From 06f30e0d9118088cf98f34ae74d898d816946de4 Mon Sep 17 00:00:00 2001 From: Alex Panturu Date: Fri, 24 May 2024 16:26:09 +0300 Subject: [PATCH] explorer: update AnchorButton test --- .../components/__tests__/AnchorButton.spec.js | 7 ++- .../__snapshots__/AnchorButton.spec.js.snap | 49 +++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/explorer/src/lib/dusk/components/__tests__/AnchorButton.spec.js b/explorer/src/lib/dusk/components/__tests__/AnchorButton.spec.js index 98417aa383..092f84d019 100644 --- a/explorer/src/lib/dusk/components/__tests__/AnchorButton.spec.js +++ b/explorer/src/lib/dusk/components/__tests__/AnchorButton.spec.js @@ -1,5 +1,3 @@ -// @ts-nocheck - import { afterEach, describe, expect, it } from "vitest"; import { cleanup, render } from "@testing-library/svelte"; import { mdiFolderOutline } from "@mdi/js"; @@ -15,6 +13,7 @@ describe("AnchorButton", () => { props: baseProps, target: document.body, }; + const iconPositions = /** @type {const} */ (["after", "before", undefined]); afterEach(cleanup); @@ -56,7 +55,7 @@ describe("AnchorButton", () => { }); it("should be able to render a AnchorButton with an icon and text", () => { - ["after", "before"].forEach((position) => { + iconPositions.forEach((position) => { const props = { ...baseProps, icon: { @@ -71,7 +70,7 @@ describe("AnchorButton", () => { }); it("should be able to render a AnchorButton with an icon only", () => { - ["after", "before"].forEach((position) => { + iconPositions.forEach((position) => { const props = { ...baseProps, icon: { diff --git a/explorer/src/lib/dusk/components/__tests__/__snapshots__/AnchorButton.spec.js.snap b/explorer/src/lib/dusk/components/__tests__/__snapshots__/AnchorButton.spec.js.snap index e64474dc92..e6a93f5359 100644 --- a/explorer/src/lib/dusk/components/__tests__/__snapshots__/AnchorButton.spec.js.snap +++ b/explorer/src/lib/dusk/components/__tests__/__snapshots__/AnchorButton.spec.js.snap @@ -70,6 +70,33 @@ exports[`AnchorButton > should be able to render a AnchorButton with an icon and `; +exports[`AnchorButton > should be able to render a AnchorButton with an icon and text 3`] = ` + + + some text + + + + + + + + + +`; + exports[`AnchorButton > should be able to render a AnchorButton with an icon only 1`] = ` should be able to render a AnchorButton with an icon onl `; +exports[`AnchorButton > should be able to render a AnchorButton with an icon only 3`] = ` + + + + + + + + + +`; + exports[`AnchorButton > should pass additional class names and attributes to the rendered element 1`] = `