mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 14:52:00 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -3,11 +3,29 @@
|
|||
import { logger } from "./core/logger";
|
||||
import { Runner } from "./core/runner";
|
||||
import { urlParams } from "./core/url";
|
||||
import { makeRuntimeHook } from "./hoot_utils";
|
||||
import { copyAndBind, makeRuntimeHook } from "./hoot_utils";
|
||||
import { setRunner } from "./main_runner";
|
||||
import { setupHootUI } from "./ui/setup_hoot_ui";
|
||||
|
||||
/**
|
||||
* @typedef {import("../hoot-dom/helpers/dom").Dimensions} Dimensions
|
||||
* @typedef {import("../hoot-dom/helpers/dom").FormatXmlOptions} FormatXmlOptions
|
||||
* @typedef {import("../hoot-dom/helpers/dom").Position} Position
|
||||
* @typedef {import("../hoot-dom/helpers/dom").QueryOptions} QueryOptions
|
||||
* @typedef {import("../hoot-dom/helpers/dom").QueryRectOptions} QueryRectOptions
|
||||
* @typedef {import("../hoot-dom/helpers/dom").QueryTextOptions} QueryTextOptions
|
||||
* @typedef {import("../hoot-dom/helpers/dom").Target} Target
|
||||
*
|
||||
* @typedef {import("../hoot-dom/helpers/events").DragHelpers} DragHelpers
|
||||
* @typedef {import("../hoot-dom/helpers/events").DragOptions} DragOptions
|
||||
* @typedef {import("../hoot-dom/helpers/events").EventType} EventType
|
||||
* @typedef {import("../hoot-dom/helpers/events").FillOptions} FillOptions
|
||||
* @typedef {import("../hoot-dom/helpers/events").InputValue} InputValue
|
||||
* @typedef {import("../hoot-dom/helpers/events").KeyStrokes} KeyStrokes
|
||||
* @typedef {import("../hoot-dom/helpers/events").PointerOptions} PointerOptions
|
||||
*
|
||||
* @typedef {import("./mock/network").ServerWebSocket} ServerWebSocket
|
||||
*
|
||||
* @typedef {{
|
||||
* runner: Runner;
|
||||
* ui: import("./ui/setup_hoot_ui").UiState
|
||||
|
|
@ -26,19 +44,12 @@ setRunner(runner);
|
|||
// Exports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param {...unknown} values
|
||||
*/
|
||||
export function registerDebugInfo(...values) {
|
||||
logger.logDebug(...values);
|
||||
}
|
||||
|
||||
// Main test API
|
||||
export const describe = runner.describe;
|
||||
export const expect = runner.expect;
|
||||
export const test = runner.test;
|
||||
|
||||
// Hooks
|
||||
// Test hooks
|
||||
export const after = makeRuntimeHook("after");
|
||||
export const afterEach = makeRuntimeHook("afterEach");
|
||||
export const before = makeRuntimeHook("before");
|
||||
|
|
@ -48,7 +59,7 @@ export const onError = makeRuntimeHook("onError");
|
|||
// Fixture
|
||||
export const getFixture = runner.fixture.get;
|
||||
|
||||
// Other functions
|
||||
// Other test runner functions
|
||||
export const definePreset = runner.exportFn(runner.definePreset);
|
||||
export const dryRun = runner.exportFn(runner.dryRun);
|
||||
export const getCurrent = runner.exportFn(runner.getCurrent);
|
||||
|
|
@ -61,59 +72,102 @@ export { defineTags } from "./core/tag";
|
|||
export { createJobScopedGetter } from "./hoot_utils";
|
||||
|
||||
// Constants
|
||||
export const globals = {
|
||||
AbortController: globalThis.AbortController,
|
||||
Array: globalThis.Array,
|
||||
Boolean: globalThis.Boolean,
|
||||
DataTransfer: globalThis.DataTransfer,
|
||||
Date: globalThis.Date,
|
||||
Document: globalThis.Document,
|
||||
Element: globalThis.Element,
|
||||
Error: globalThis.Error,
|
||||
ErrorEvent: globalThis.ErrorEvent,
|
||||
EventTarget: globalThis.EventTarget,
|
||||
Map: globalThis.Map,
|
||||
MutationObserver: globalThis.MutationObserver,
|
||||
Number: globalThis.Number,
|
||||
Object: globalThis.Object,
|
||||
ProgressEvent: globalThis.ProgressEvent,
|
||||
Promise: globalThis.Promise,
|
||||
PromiseRejectionEvent: globalThis.PromiseRejectionEvent,
|
||||
Proxy: globalThis.Proxy,
|
||||
RegExp: globalThis.RegExp,
|
||||
Request: globalThis.Request,
|
||||
Response: globalThis.Response,
|
||||
Set: globalThis.Set,
|
||||
SharedWorker: globalThis.SharedWorker,
|
||||
String: globalThis.String,
|
||||
TypeError: globalThis.TypeError,
|
||||
URIError: globalThis.URIError,
|
||||
URL: globalThis.URL,
|
||||
URLSearchParams: globalThis.URLSearchParams,
|
||||
WebSocket: globalThis.WebSocket,
|
||||
Window: globalThis.Window,
|
||||
Worker: globalThis.Worker,
|
||||
XMLHttpRequest: globalThis.XMLHttpRequest,
|
||||
cancelAnimationFrame: globalThis.cancelAnimationFrame,
|
||||
clearInterval: globalThis.clearInterval,
|
||||
clearTimeout: globalThis.clearTimeout,
|
||||
console: globalThis.console,
|
||||
document: globalThis.document,
|
||||
fetch: globalThis.fetch,
|
||||
history: globalThis.history,
|
||||
JSON: globalThis.JSON,
|
||||
localStorage: globalThis.localStorage,
|
||||
location: globalThis.location,
|
||||
matchMedia: globalThis.matchMedia,
|
||||
Math: globalThis.Math,
|
||||
navigator: globalThis.navigator,
|
||||
ontouchstart: globalThis.ontouchstart,
|
||||
performance: globalThis.performance,
|
||||
requestAnimationFrame: globalThis.requestAnimationFrame,
|
||||
sessionStorage: globalThis.sessionStorage,
|
||||
setInterval: globalThis.setInterval,
|
||||
setTimeout: globalThis.setTimeout,
|
||||
};
|
||||
export const globals = copyAndBind(globalThis);
|
||||
export const isHootReady = setupHootUI();
|
||||
|
||||
// Mock
|
||||
export { disableAnimations, enableTransitions } from "./mock/animation";
|
||||
export { mockDate, mockLocale, mockTimeZone, onTimeZoneChange } from "./mock/date";
|
||||
export { makeSeededRandom } from "./mock/math";
|
||||
export { mockPermission, mockSendBeacon, mockUserAgent, mockVibrate } from "./mock/navigator";
|
||||
export { mockFetch, mockLocation, mockWebSocket, mockWorker, withFetch } from "./mock/network";
|
||||
export { flushNotifications } from "./mock/notification";
|
||||
export {
|
||||
mockMatchMedia,
|
||||
mockTouch,
|
||||
watchAddedNodes,
|
||||
watchKeys,
|
||||
watchListeners,
|
||||
} from "./mock/window";
|
||||
|
||||
// HOOT-DOM
|
||||
export {
|
||||
advanceFrame,
|
||||
advanceTime,
|
||||
animationFrame,
|
||||
cancelAllTimers,
|
||||
check,
|
||||
clear,
|
||||
click,
|
||||
dblclick,
|
||||
Deferred,
|
||||
delay,
|
||||
drag,
|
||||
edit,
|
||||
fill,
|
||||
formatXml,
|
||||
freezeTime,
|
||||
getActiveElement,
|
||||
getFocusableElements,
|
||||
getNextFocusableElement,
|
||||
getParentFrame,
|
||||
getPreviousFocusableElement,
|
||||
hover,
|
||||
isDisplayed,
|
||||
isEditable,
|
||||
isFocusable,
|
||||
isInDOM,
|
||||
isInViewPort,
|
||||
isScrollable,
|
||||
isVisible,
|
||||
keyDown,
|
||||
keyUp,
|
||||
leave,
|
||||
manuallyDispatchProgrammaticEvent,
|
||||
matches,
|
||||
microTick,
|
||||
middleClick,
|
||||
on,
|
||||
pointerDown,
|
||||
pointerUp,
|
||||
press,
|
||||
queryAll,
|
||||
queryAllAttributes,
|
||||
queryAllProperties,
|
||||
queryAllRects,
|
||||
queryAllTexts,
|
||||
queryAllValues,
|
||||
queryAny,
|
||||
queryAttribute,
|
||||
queryFirst,
|
||||
queryOne,
|
||||
queryRect,
|
||||
queryText,
|
||||
queryValue,
|
||||
resize,
|
||||
rightClick,
|
||||
runAllTimers,
|
||||
scroll,
|
||||
select,
|
||||
setFrameRate,
|
||||
setInputFiles,
|
||||
setInputRange,
|
||||
tick,
|
||||
uncheck,
|
||||
unfreezeTime,
|
||||
unload,
|
||||
waitFor,
|
||||
waitForNone,
|
||||
waitUntil,
|
||||
} from "@odoo/hoot-dom";
|
||||
|
||||
// Debug
|
||||
export { exposeHelpers } from "../hoot-dom/hoot_dom_utils";
|
||||
export const __debug__ = runner;
|
||||
|
||||
export const isHootReady = setupHootUI();
|
||||
/**
|
||||
* @param {...unknown} values
|
||||
*/
|
||||
export function registerDebugInfo(...values) {
|
||||
logger.logDebug(...values);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue