feat(cases): adiciona o case Julia Beauty com vídeo de rolagem
This commit is contained in:
1 parent
594daecd2b
commit
bcdf0099c5
26 files changed
+159
-42
No files matched your search
@@ -132,7 +132,7 @@ describe("ProjectLightbox", () => {
|
||||
expect(
|
||||
within(dialog).getByRole("button", { name: "Fechar" }),
|
||||
).toHaveFocus();
|
||||
expect(within(dialog).getByText("02 / 05")).toBeInTheDocument();
|
||||
expect(within(dialog).getByText("02 / 06")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows the desktop video in a browser frame by default and the phone version on request", () => {
|
||||
@@ -490,7 +490,7 @@ describe("ProjectLightbox: revisão", () => {
|
||||
it("announces which project is on screen", () => {
|
||||
const dialog = setup("nutriscan");
|
||||
expect(dialog.querySelector("[aria-live='polite']")).toHaveTextContent(
|
||||
"NutriScan, projeto 3 de 5",
|
||||
"NutriScan, projeto 3 de 6",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ const WEIGHTS = [
|
||||
"nutriscan",
|
||||
"sc-plus",
|
||||
"as-servicos",
|
||||
"julia-beauty",
|
||||
].map((id) => getShowcaseConfig(id)?.weight ?? 1);
|
||||
|
||||
const originalRect = Element.prototype.getBoundingClientRect;
|
||||
@@ -272,7 +273,7 @@ describe("ProjectReel: qual versão entra", () => {
|
||||
expect(reelEl()).toBeNull();
|
||||
const list = listEl() as HTMLElement;
|
||||
expect(list).not.toBeNull();
|
||||
expect(list.querySelectorAll("li[data-device='desktop']")).toHaveLength(5);
|
||||
expect(list.querySelectorAll("li[data-device='desktop']")).toHaveLength(6);
|
||||
expect(list.querySelector(".ds-phone")).toBeNull();
|
||||
expect(list).not.toHaveAttribute("data-pending");
|
||||
});
|
||||
@@ -285,7 +286,7 @@ describe("ProjectReel: qual versão entra", () => {
|
||||
expect(reelEl()).toBeNull();
|
||||
expect(
|
||||
(listEl() as HTMLElement).querySelectorAll("li[data-device='mobile']"),
|
||||
).toHaveLength(5);
|
||||
).toHaveLength(6);
|
||||
});
|
||||
|
||||
it("path: phone width and reduced motion at once -> still the list", () => {
|
||||
@@ -330,13 +331,13 @@ describe("ProjectReel: qual versão entra", () => {
|
||||
renderReel();
|
||||
expect(
|
||||
(listEl() as HTMLElement).querySelectorAll("li[data-device='desktop']"),
|
||||
).toHaveLength(5);
|
||||
).toHaveLength(6);
|
||||
|
||||
changeMedia(MOBILE_QUERY, true);
|
||||
|
||||
expect(
|
||||
(listEl() as HTMLElement).querySelectorAll("li[data-device='mobile']"),
|
||||
).toHaveLength(5);
|
||||
).toHaveLength(6);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -780,7 +781,7 @@ describe("ProjectReel: rolagem suave até um projeto", () => {
|
||||
([options]) => options.top as number,
|
||||
);
|
||||
const finalTop = tops[tops.length - 1];
|
||||
// o destino da Lavação (2º projeto) fica bem antes do da AS Serviços (último)
|
||||
// o destino da Lavação (2º projeto) fica bem antes do da AS Serviços (5º)
|
||||
expect(finalTop).toBeLessThan(reelTopFor(4));
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -60,6 +60,7 @@ describe("buildShowcaseItems", () => {
|
||||
"nutriscan",
|
||||
"sc-plus",
|
||||
"as-servicos",
|
||||
"julia-beauty",
|
||||
]);
|
||||
expect(
|
||||
buildShowcaseItems(projects.filter((p) => p.id === "twins-lab")),
|
||||
|
||||
Reference in new issue
Block a user