Home / File/ DOMPluginEventSystem-test.internal.js — react Source File

DOMPluginEventSystem-test.internal.js — react Source File

Architecture documentation for DOMPluginEventSystem-test.internal.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript BabelCompiler Validation 1 imports 4 functions

Entity Profile

Dependency Diagram

graph LR
  f49c62fb_66ce_807d_c5e2_61d3a843559a["DOMPluginEventSystem-test.internal.js"]
  b4dc19b6_7d5e_9e7c_9b54_7cf573382943["dom-event-testing-library"]
  f49c62fb_66ce_807d_c5e2_61d3a843559a --> b4dc19b6_7d5e_9e7c_9b54_7cf573382943
  style f49c62fb_66ce_807d_c5e2_61d3a843559a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @emails react-core
 */

'use strict';

import {createEventTarget} from 'dom-event-testing-library';

let React;
let ReactFeatureFlags;
let ReactDOM;
let ReactDOMClient;
let ReactDOMServer;
let Scheduler;
let act;
let waitForAll;
let waitFor;

function dispatchEvent(element, type) {
  const event = document.createEvent('Event');
  event.initEvent(type, true, true);
  element.dispatchEvent(event);
}

function dispatchClickEvent(element) {
  dispatchEvent(element, 'click');
}

const eventListenersToClear = [];

function startNativeEventListenerClearDown() {
  const nativeWindowEventListener = window.addEventListener;
  window.addEventListener = function (...params) {
    eventListenersToClear.push({target: window, params});
    return nativeWindowEventListener.apply(this, params);
  };
  const nativeDocumentEventListener = document.addEventListener;
  document.addEventListener = function (...params) {
    eventListenersToClear.push({target: document, params});
    return nativeDocumentEventListener.apply(this, params);
  };
}

function endNativeEventListenerClearDown() {
  eventListenersToClear.forEach(({target, params}) => {
    target.removeEventListener(...params);
  });
}

describe('DOMPluginEventSystem', () => {
  let container;

  function withEnableLegacyFBSupport(enableLegacyFBSupport) {
    describe(
      'enableLegacyFBSupport ' +
// ... (3349 more lines)

Domain

Subdomains

Dependencies

  • dom-event-testing-library

Frequently Asked Questions

What does DOMPluginEventSystem-test.internal.js do?
DOMPluginEventSystem-test.internal.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in DOMPluginEventSystem-test.internal.js?
DOMPluginEventSystem-test.internal.js defines 4 function(s): dispatchClickEvent, dispatchEvent, endNativeEventListenerClearDown, startNativeEventListenerClearDown.
What does DOMPluginEventSystem-test.internal.js depend on?
DOMPluginEventSystem-test.internal.js imports 1 module(s): dom-event-testing-library.
Where is DOMPluginEventSystem-test.internal.js in the architecture?
DOMPluginEventSystem-test.internal.js is located at packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom/src/events/__tests__).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free