main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _adapters = require("./adapters");
describe("adaptForAppRouterInstance", ()=>{
beforeEach(()=>jest.resetAllMocks());
const router = {
back: jest.fn(),
forward: jest.fn(),
reload: jest.fn(),
push: jest.fn(),
replace: jest.fn(),
prefetch: jest.fn()
};
const adapter = (0, _adapters.adaptForAppRouterInstance)(router);
it("should forward a call to `back()`", ()=>{
adapter.back();
expect(router.back).toHaveBeenCalled();
});
it("should forward a call to `forward()`", ()=>{
adapter.forward();
expect(router.forward).toHaveBeenCalled();
});
it("should forward a call to `reload()`", ()=>{
adapter.refresh();
expect(router.reload).toHaveBeenCalled();
});
it("should forward a call to `push()`", ()=>{
adapter.push("/foo");
expect(router.push).toHaveBeenCalledWith("/foo", undefined, {
scroll: undefined
});
});
it("should forward a call to `push()` with options", ()=>{
adapter.push("/foo", {
scroll: false
});
expect(router.push).toHaveBeenCalledWith("/foo", undefined, {
scroll: false
});
});
it("should forward a call to `replace()`", ()=>{
adapter.replace("/foo");
expect(router.replace).toHaveBeenCalledWith("/foo", undefined, {
scroll: undefined
});
});
it("should forward a call to `replace()` with options", ()=>{
adapter.replace("/foo", {
scroll: false
});
expect(router.replace).toHaveBeenCalledWith("/foo", undefined, {
scroll: false
});
});
it("should forward a call to `prefetch()`", ()=>{
adapter.prefetch("/foo");
expect(router.prefetch).toHaveBeenCalledWith("/foo");
});
});
//# sourceMappingURL=adapters.test.js.map