Home / File/ storeComponentFilters-test.js — react Source File

storeComponentFilters-test.js — react Source File

Architecture documentation for storeComponentFilters-test.js, a javascript file in the react codebase. 4 imports, 0 dependents.

File javascript BabelCompiler Validation 4 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  03df98bf_ce05_9755_cb7b_8df25e14920b["storeComponentFilters-test.js"]
  7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4["utils.js"]
  03df98bf_ce05_9755_cb7b_8df25e14920b --> 7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4
  026f470e_4718_4a16_f9eb_8e2406332f5a["getLegacyRenderImplementation"]
  03df98bf_ce05_9755_cb7b_8df25e14920b --> 026f470e_4718_4a16_f9eb_8e2406332f5a
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  03df98bf_ce05_9755_cb7b_8df25e14920b --> 4077b620_5c59_61c2_0910_273f565da757
  baf70b0e_4867_b3ed_962a_e5c9ae820fef["store"]
  03df98bf_ce05_9755_cb7b_8df25e14920b --> baf70b0e_4867_b3ed_962a_e5c9ae820fef
  style 03df98bf_ce05_9755_cb7b_8df25e14920b 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.
 *
 * @flow
 */

import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
import type Store from 'react-devtools-shared/src/devtools/store';

import {
  getLegacyRenderImplementation,
  getVersionedRenderImplementation,
} from './utils';

describe('Store component filters', () => {
  let React;
  let Types;
  let agent;
  let bridge: FrontendBridge;
  let store: Store;
  let utils;
  let actAsync;

  beforeAll(() => {
    // JSDDOM doesn't implement getClientRects so we're just faking one for testing purposes
    Element.prototype.getClientRects = function (this: Element) {
      const textContent = this.textContent;
      return [
        new DOMRect(1, 2, textContent.length, textContent.split('\n').length),
      ];
    };
  });

  beforeEach(() => {
    agent = global.agent;
    bridge = global.bridge;
    store = global.store;
    store.collapseNodesByDefault = false;
    store.componentFilters = [];
    store.recordChangeDescriptions = true;

    React = require('react');
    Types = require('react-devtools-shared/src/frontend/types');
    utils = require('./utils');

    actAsync = utils.actAsync;
  });

  const {render} = getVersionedRenderImplementation();

  // @reactVersion >= 16.0
  it('should throw if filters are updated while profiling', async () => {
    await actAsync(async () => store.profilerStore.startProfiling());
    expect(() => (store.componentFilters = [])).toThrow(
      'Cannot modify filter preferences while profiling',
    );
  });
// ... (872 more lines)

Domain

Subdomains

Classes

Dependencies

Frequently Asked Questions

What does storeComponentFilters-test.js do?
storeComponentFilters-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What does storeComponentFilters-test.js depend on?
storeComponentFilters-test.js imports 4 module(s): bridge, getLegacyRenderImplementation, store, utils.js.
Where is storeComponentFilters-test.js in the architecture?
storeComponentFilters-test.js is located at packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free