diff --git a/.changeset/spicy-carpets-win.md b/.changeset/spicy-carpets-win.md new file mode 100644 index 00000000..c36e5277 --- /dev/null +++ b/.changeset/spicy-carpets-win.md @@ -0,0 +1,6 @@ +--- +"@tapsioss/web-components": patch +--- + +Use slot variables in test renderings. + \ No newline at end of file diff --git a/packages/web-components/src/badge-wrapper/badge-wrapper.test.ts b/packages/web-components/src/badge-wrapper/badge-wrapper.test.ts index 374ab4be..8cb68f32 100644 --- a/packages/web-components/src/badge-wrapper/badge-wrapper.test.ts +++ b/packages/web-components/src/badge-wrapper/badge-wrapper.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 badge-wrapper", () => { test("🧪 should show anchor and badge slots in all anchor shapes", async ({ @@ -11,7 +12,7 @@ describe("🧩 badge-wrapper", () => { page, ` - + click `, ); @@ -31,7 +32,7 @@ describe("🧩 badge-wrapper", () => { page, ` - +
`, ); @@ -83,7 +84,7 @@ describe("🧩 badge-wrapper", () => { page, ` - +
`, ); @@ -135,7 +136,7 @@ describe("🧩 badge-wrapper", () => { page, ` - +
`, ); diff --git a/packages/web-components/src/badge/badge.test.ts b/packages/web-components/src/badge/badge.test.ts index 01f84b5f..7afff465 100644 --- a/packages/web-components/src/badge/badge.test.ts +++ b/packages/web-components/src/badge/badge.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 badge", () => { test("🧪 should show value when variant is not `dot`", async ({ page }) => { @@ -27,7 +28,7 @@ describe("🧩 badge", () => { page, }) => { const iconSlot = ` - + `; diff --git a/packages/web-components/src/banner/banner.test.ts b/packages/web-components/src/banner/banner.test.ts index 928eb5cc..13566f1d 100644 --- a/packages/web-components/src/banner/banner.test.ts +++ b/packages/web-components/src/banner/banner.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 banner", () => { test("🧪 should render banner elements", async ({ page }) => { @@ -11,7 +12,7 @@ describe("🧩 banner", () => { description="description" image="https://picsum.photos/200" > - click + click `, ); diff --git a/packages/web-components/src/bottom-navigation/bottom-navigation.test.ts b/packages/web-components/src/bottom-navigation/bottom-navigation.test.ts index c0c0cfc4..7178b3e5 100644 --- a/packages/web-components/src/bottom-navigation/bottom-navigation.test.ts +++ b/packages/web-components/src/bottom-navigation/bottom-navigation.test.ts @@ -8,6 +8,7 @@ import { setupMocks, test, } from "@internals/test-helpers"; +import { Slots } from "./item/constants.ts"; import { type BottomNavigationItem } from "./item/index.ts"; describe("🧩 bottom-navigation-item", () => { @@ -101,7 +102,7 @@ describe("🧩 bottom-navigation-item", () => { page, ` - + آیتم ۱ diff --git a/packages/web-components/src/button/standard/button.test.ts b/packages/web-components/src/button/standard/button.test.ts index 51d16389..999baad8 100644 --- a/packages/web-components/src/button/standard/button.test.ts +++ b/packages/web-components/src/button/standard/button.test.ts @@ -7,6 +7,7 @@ import { setupMocks, test, } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 button", () => { afterEach(async ({ page }) => { @@ -177,11 +178,11 @@ describe("🧩 button", () => { page, ` - + کلیک کنید - + `, diff --git a/packages/web-components/src/chip/chip.test.ts b/packages/web-components/src/chip/chip.test.ts index d51bffba..5a785858 100644 --- a/packages/web-components/src/chip/chip.test.ts +++ b/packages/web-components/src/chip/chip.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 chip", () => { test("🧪 should toggle with keyboard interaction", async ({ page }) => { @@ -41,11 +42,11 @@ describe("🧩 chip", () => { page, ` - + چیپ - + `, diff --git a/packages/web-components/src/discount-card/discount-card.test.ts b/packages/web-components/src/discount-card/discount-card.test.ts index 86b6ba77..3757b7c7 100644 --- a/packages/web-components/src/discount-card/discount-card.test.ts +++ b/packages/web-components/src/discount-card/discount-card.test.ts @@ -8,7 +8,7 @@ import { render, test, } from "@internals/test-helpers"; -import { ErrorMessages } from "./constants.ts"; +import { ErrorMessages, Slots } from "./constants.ts"; describe("🧩 discount-card", () => { const scope = "discount-card"; @@ -47,7 +47,7 @@ describe("🧩 discount-card", () => { badge-text="10%" expiry-date-label="Expires in 2 days" > - + `, @@ -84,11 +84,11 @@ describe("🧩 discount-card", () => { badge-text="10%" expiry-date-label="Expires in 2 days" > - + - Thumbnail - Use Discount + Thumbnail + Use Discount `, ); @@ -131,7 +131,7 @@ describe("🧩 discount-card", () => { badge-text="10%" expiry-date-label="Expires in 2 days" > - + `, @@ -235,7 +235,7 @@ describe("🧩 discount-card", () => { ${ variant !== "none" ? ` - + ` @@ -312,13 +312,13 @@ describe("🧩 discount-card", () => { ${ variant !== "none" ? ` - + ` : "" } - Use Discount + Use Discount `, ); diff --git a/packages/web-components/src/modal/modal.test.ts b/packages/web-components/src/modal/modal.test.ts index 8dc43dae..c9e255be 100644 --- a/packages/web-components/src/modal/modal.test.ts +++ b/packages/web-components/src/modal/modal.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 modal", () => { test("🧪 should show elements based on props and slots", async ({ page }) => { @@ -11,8 +12,8 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - image - + image + click click @@ -44,7 +45,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -77,7 +78,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -114,7 +115,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -140,7 +141,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -167,7 +168,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -178,7 +179,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click @@ -189,7 +190,7 @@ describe("🧩 modal", () => { description="دسکریپشن" open > - + click click diff --git a/packages/web-components/src/notice/notice.test.ts b/packages/web-components/src/notice/notice.test.ts index 28a8d9c7..f0f4ad0d 100644 --- a/packages/web-components/src/notice/notice.test.ts +++ b/packages/web-components/src/notice/notice.test.ts @@ -1,4 +1,5 @@ import { describe, expect, render, test } from "@internals/test-helpers"; +import { Slots } from "./constants.ts"; describe("🧩 notice", () => { test("🧪 should be visible only if `visible` attribute was set", async ({ @@ -115,11 +116,11 @@ describe("🧩 notice", () => { artwork="custom" visible > - + - اکشن ۱ - اکشن ۲ + اکشن ۱ + اکشن ۲ `, ); @@ -143,7 +144,7 @@ describe("🧩 notice", () => { artwork="none" visible > - + @@ -167,7 +168,7 @@ describe("🧩 notice", () => { visible variant="compact" > - اکشن ۱ + اکشن ۱ `, ); diff --git a/packages/web-components/src/text-area/text-area.test.ts b/packages/web-components/src/text-area/text-area.test.ts index c8f27dbd..614aacf3 100644 --- a/packages/web-components/src/text-area/text-area.test.ts +++ b/packages/web-components/src/text-area/text-area.test.ts @@ -7,7 +7,10 @@ import { render, test, } from "@internals/test-helpers"; -import { ErrorMessages as BaseErrorMessages } from "../base-text-input/constants.ts"; +import { + ErrorMessages as BaseErrorMessages, + Slots, +} from "../base-text-input/constants.ts"; import { ErrorMessages } from "./constants.ts"; describe("🧩 text-area", () => { @@ -82,10 +85,10 @@ describe("🧩 text-area", () => { page, ` - + - click + click `, ); diff --git a/packages/web-components/src/text-field/text-field.test.ts b/packages/web-components/src/text-field/text-field.test.ts index eeba81bf..87a899cf 100644 --- a/packages/web-components/src/text-field/text-field.test.ts +++ b/packages/web-components/src/text-field/text-field.test.ts @@ -8,7 +8,7 @@ import { setupMocks, test, } from "@internals/test-helpers"; -import { ErrorMessages } from "../base-text-input/constants.ts"; +import { ErrorMessages, Slots } from "../base-text-input/constants.ts"; import { type TextField } from "./index.ts"; describe("🧩 text-field", () => { @@ -122,10 +122,10 @@ describe("🧩 text-field", () => { page, ` - + - click + click `, );