feat(cases): adiciona o case Julia Beauty com vídeo de rolagem
CI / audit (push) Failing after 5m27s
CI / e2e (push) Failing after 11m23s
CI / verify (push) Successful in 11m31s
CI / deploy (push) Successful in 1m19s

This commit is contained in:
evandro committed 2026-10-24 04:50:58 -03:00
1 parent 594daecd2b
commit bcdf0099c5
26 files changed
+159 -42

No files matched your search

+13 -11
View File
@@ -56,6 +56,7 @@ const weights = [
"nutriscan",
"sc-plus",
"as-servicos",
"julia-beauty",
].map((id) => getShowcaseConfig(id)?.weight ?? 1);
const originalRect = Element.prototype.getBoundingClientRect;
@@ -210,7 +211,7 @@ describe("ProjectReel", () => {
).toBeNull();
expect(document.querySelector(".ds-reel")).toBeNull();
const list = screen.getByRole("region", { name: "Projetos de clientes" });
expect(within(list).getAllByRole("heading", { level: 3 })).toHaveLength(5);
expect(within(list).getAllByRole("heading", { level: 3 })).toHaveLength(6);
expect(document.querySelector("video")).toBeNull();
});
@@ -231,7 +232,7 @@ describe("ProjectReel", () => {
);
expect(posters.length).toBeGreaterThan(0);
for (const poster of posters) expect(poster).toContain("mobile.webp");
expect(list.querySelectorAll(".ds-phone")).toHaveLength(5);
expect(list.querySelectorAll(".ds-phone")).toHaveLength(6);
expect(list.querySelector(".ds-bframe")).toBeNull();
});
@@ -258,6 +259,7 @@ describe("ProjectReel", () => {
"NutriScan",
"SC Plus Aquicultura",
"AS Serviços",
"Julia Beauty",
])
expect(within(nav).getByRole("button", { name })).toBeInTheDocument();
expect(
@@ -272,7 +274,7 @@ describe("ProjectReel", () => {
it("hides the layers that are not on screen from assistive technology and from the keyboard", () => {
renderReel();
const layers = [...document.querySelectorAll(".ds-reel-layer")];
expect(layers).toHaveLength(5);
expect(layers).toHaveLength(6);
for (const layer of layers.slice(1)) {
expect(layer).toHaveAttribute("aria-hidden", "true");
expect(layer).toHaveAttribute("inert");
@@ -338,7 +340,7 @@ describe("ProjectReel", () => {
expect(first.currentTime).toBe(0);
scrollTo(1);
expect(caption()).toHaveTextContent("AS Serviços");
expect(caption()).toHaveTextContent("Julia Beauty");
const last = activeLayer().querySelector(
".ds-reel-screen video",
) as HTMLVideoElement;
@@ -381,7 +383,7 @@ describe("ProjectReel", () => {
});
loaded = sources().filter(Boolean);
expect(
loaded.some((src) => src?.includes("as-servicos/scrub-desktop.mp4")),
loaded.some((src) => src?.includes("julia-beauty/scrub-desktop.mp4")),
).toBe(true);
expect(loaded.some((src) => src?.includes("sev-modaintima"))).toBe(false);
});
@@ -558,8 +560,8 @@ describe("ProjectReel", () => {
).toHaveClass("ds-link-muted");
expect(document.querySelector(".ds-reel .ds-link-accent")).toBeNull();
// sem demoUrl não há "Abrir site"
scrollTo(1);
// sem demoUrl não há "Abrir site" (AS Serviços, 5º projeto)
scrollTo(reelOffset(weights, 4, 0.5));
expect(caption()).toHaveTextContent("AS Serviços");
expect(
within(caption()).queryByRole("link", { name: /Abrir site/ }),
@@ -635,7 +637,7 @@ describe("ProjectReel: a troca de projeto não duplica nada na tela", () => {
expect(document.querySelectorAll(".ds-reel-title")).toHaveLength(1);
expect(document.querySelectorAll(".ds-reel-chapter-count")).toHaveLength(1);
expect(document.querySelectorAll(".ds-reel-actions")).toHaveLength(1);
expect(document.querySelectorAll(".ds-reel-layer")).toHaveLength(5);
expect(document.querySelectorAll(".ds-reel-layer")).toHaveLength(6);
for (const layer of document.querySelectorAll(".ds-reel-layer")) {
expect(layer.closest(".ds-reel-caption")).toBeNull();
expect(layer.querySelector(".ds-reel-caption")).toBeNull();
@@ -782,8 +784,8 @@ describe("ProjectReel: teclado do índice (roving tabindex)", () => {
it("makes the whole index ONE tab stop (the current project), however many projects and chapters it lists", () => {
renderReel();
const buttons = within(index()).getAllByRole("button");
// 5 projetos e os 2 trechos do projeto em cena: 7 botões, uma parada
expect(buttons).toHaveLength(5 + 2);
// 6 projetos e os 2 trechos do projeto em cena: 8 botões, uma parada
expect(buttons).toHaveLength(6 + 2);
expect(stops()).toHaveLength(1);
expect(stops()[0]).toHaveAttribute("aria-current", "true");
expect(stops()[0]).toHaveAccessibleName("SEV Moda Íntima");
@@ -895,7 +897,7 @@ describe("ProjectReel: teclado do índice (roving tabindex)", () => {
fireEvent.keyDown(document.activeElement as Element, { key: "End" });
expect(document.activeElement).toHaveAccessibleName(/Abrir site/);
scrollTo(1); // AS Serviços: sem site
scrollTo(reelOffset(weights, 4, 0.5)); // AS Serviços: sem site
act(() => {
jest.advanceTimersByTime(CAPTION_OUT_MS + 40);
});