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

traceUpdates-test.js — react Source File

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

File javascript 1 imports

Entity Profile

Dependency Diagram

graph LR
  e3e9981d_faec_e628_d4e9_f2903836b2ed["traceUpdates-test.js"]
  403e272f_c8e8_6a9a_da71_4eaa9e5cc05e["canvas"]
  e3e9981d_faec_e628_d4e9_f2903836b2ed --> 403e272f_c8e8_6a9a_da71_4eaa9e5cc05e
  style e3e9981d_faec_e628_d4e9_f2903836b2ed fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {groupAndSortNodes} from 'react-devtools-shared/src/backend/views/TraceUpdates/canvas';

describe('Trace updates group and sort nodes', () => {
  test('should group nodes by position without changing order within group', () => {
    const nodeToData = new Map([
      [
        {id: 1},
        {
          rect: {left: 0, top: 0, width: 100, height: 100},
          color: '#80b393',
          displayName: 'Node1',
          count: 3,
        },
      ],
      [
        {id: 2},
        {
          rect: {left: 0, top: 0, width: 100, height: 100},
          color: '#63b19e',
          displayName: 'Node2',
          count: 2,
        },
      ],
    ]);

    const result = groupAndSortNodes(nodeToData);

    expect(result).toEqual([
      [
        {
          rect: {left: 0, top: 0, width: 100, height: 100},
          color: '#80b393',
          displayName: 'Node1',
          count: 3,
        },
        {
          rect: {left: 0, top: 0, width: 100, height: 100},
          color: '#63b19e',
          displayName: 'Node2',
          count: 2,
        },
      ],
    ]);
  });

  test('should sort groups by lowest count in each group', () => {
    const nodeToData = new Map([
      [
        {id: 1},
        {
          rect: {left: 0, top: 0, width: 100, height: 100},
          color: '#97b488',
          displayName: 'Group1',
          count: 4,
        },
      ],
      [
        {id: 2},
        {
          rect: {left: 100, top: 0, width: 100, height: 100},
// ... (210 more lines)

Dependencies

  • canvas

Frequently Asked Questions

What does traceUpdates-test.js do?
traceUpdates-test.js is a source file in the react codebase, written in javascript.
What does traceUpdates-test.js depend on?
traceUpdates-test.js imports 1 module(s): canvas.
Where is traceUpdates-test.js in the architecture?
traceUpdates-test.js is located at packages/react-devtools-shared/src/__tests__/traceUpdates-test.js (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