perf(movimento): vitrine e 3D mais leves, WebGL por software lembrado na sessão e suporte ao WebKit
This commit is contained in:
1 parent
9fd1570426
commit
8903f3c57e
28 files changed
+854
-406
No files matched your search
@@ -1,11 +1,9 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { setNavigation } from "@/__mocks__/next/navigation";
|
||||
import { resetFocusOnNavigation } from "./hooks/useFocusOnNavigation";
|
||||
import Template from "./template";
|
||||
|
||||
let mockPathname = "/cases";
|
||||
jest.mock("next/navigation", () => ({ usePathname: () => mockPathname }));
|
||||
|
||||
const mockMounts = jest.fn();
|
||||
const mockProps: Array<Record<string, unknown>> = [];
|
||||
|
||||
@@ -34,7 +32,7 @@ function Counter() {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
mockPathname = "/cases";
|
||||
setNavigation({ pathname: "/cases" });
|
||||
mockMounts.mockClear();
|
||||
mockProps.length = 0;
|
||||
resetFocusOnNavigation();
|
||||
@@ -70,7 +68,7 @@ describe("app/template", () => {
|
||||
expect(mockMounts).toHaveBeenCalledTimes(1);
|
||||
expect(screen.getByTestId("state")).toHaveTextContent("1");
|
||||
|
||||
mockPathname = "/cases/sev-modaintima";
|
||||
setNavigation({ pathname: "/cases/sev-modaintima" });
|
||||
rerender(
|
||||
<Template>
|
||||
<Counter />
|
||||
@@ -108,7 +106,7 @@ describe("app/template", () => {
|
||||
expect(focus).not.toHaveBeenCalled();
|
||||
expect(screen.getByTestId("main")).not.toHaveFocus();
|
||||
|
||||
mockPathname = "/cases/sev-modaintima";
|
||||
setNavigation({ pathname: "/cases/sev-modaintima" });
|
||||
rerender(
|
||||
<Shell>
|
||||
<button type="button">Dentro da página</button>
|
||||
@@ -147,7 +145,7 @@ describe("app/template", () => {
|
||||
<p>Página</p>
|
||||
</Shell>,
|
||||
);
|
||||
mockPathname = "/servicos";
|
||||
setNavigation({ pathname: "/servicos" });
|
||||
rerender(
|
||||
<Shell>
|
||||
<p>Página</p>
|
||||
|
||||
Reference in new issue
Block a user