diff --git a/tests/App.test.svelte b/tests/App.test.svelte index 71142b090f..4a7e47c7f1 100644 --- a/tests/App.test.svelte +++ b/tests/App.test.svelte @@ -1,5 +1,6 @@ - - - Content - diff --git a/tests/AspectRatio/AspectRatio.test.svelte b/tests/AspectRatio/AspectRatio.test.svelte new file mode 100644 index 0000000000..bb147588d7 --- /dev/null +++ b/tests/AspectRatio/AspectRatio.test.svelte @@ -0,0 +1,13 @@ + + +2x1 +2x3 +16x9 +4x3 +1x1 +3x4 +3x2 +9x16 +1x2 diff --git a/tests/AspectRatio/AspectRatio.test.ts b/tests/AspectRatio/AspectRatio.test.ts new file mode 100644 index 0000000000..7362d90b36 --- /dev/null +++ b/tests/AspectRatio/AspectRatio.test.ts @@ -0,0 +1,15 @@ +import { render, screen } from "@testing-library/svelte"; +import AspectRatio from "./AspectRatio.test.svelte"; + +describe("AspectRatio", () => { + it("renders correctly", () => { + render(AspectRatio); + + ["2x1", "2x3", "16x9", "4x3", "1x1", "3x4", "3x2", "9x16", "1x2"].forEach( + (ratio) => { + const boundingElement = screen.getByText(ratio).parentElement; + expect(boundingElement).toHaveClass(`bx--aspect-ratio--${ratio}`); + }, + ); + }); +});