Home / File/ svg.spec.ts — vue Source File

svg.spec.ts — vue Source File

Architecture documentation for svg.spec.ts, a typescript file in the vue codebase. 3 imports, 0 dependents.

File typescript VueCore Observer 3 imports 2 classes

Entity Profile

Dependency Diagram

graph LR
  62707277_f50d_552d_eb4c_fe15c1d2e201["svg.spec.ts"]
  89e1d5c3_816b_464a_8e3e_7496dffe6752["e2eUtils.ts"]
  62707277_f50d_552d_eb4c_fe15c1d2e201 --> 89e1d5c3_816b_464a_8e3e_7496dffe6752
  29f97b51_38b6_0943_0c18_913d76c86b26["setupPuppeteer"]
  62707277_f50d_552d_eb4c_fe15c1d2e201 --> 29f97b51_38b6_0943_0c18_913d76c86b26
  0409ae0b_e495_6959_8f5e_6f3562f01086["getExampleUrl"]
  62707277_f50d_552d_eb4c_fe15c1d2e201 --> 0409ae0b_e495_6959_8f5e_6f3562f01086
  style 62707277_f50d_552d_eb4c_fe15c1d2e201 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { setupPuppeteer, getExampleUrl, E2E_TIMEOUT } from './e2eUtils'

declare const globalStats: {
  label: string
  value: number
}[]

declare function valueToPoint(
  value: number,
  index: number,
  total: number
): {
  x: number
  y: number
}

describe('e2e: svg', () => {
  const { page, click, count, setValue, typeValue } = setupPuppeteer()

  // assert the shape of the polygon is correct
  async function assertPolygon(total: number) {
    expect(
      await page().evaluate(
        total => {
          const points = globalStats
            .map((stat, i) => {
              const point = valueToPoint(stat.value, i, total)
              return point.x + ',' + point.y
            })
            .join(' ')
          return (
            document.querySelector('polygon')!.attributes[0].value === points
          )
        },
        [total]
      )
    ).toBe(true)
  }

  // assert the position of each label is correct
  async function assertLabels(total: number) {
    const positions = await page().evaluate(
      total => {
        return globalStats.map((stat, i) => {
          const point = valueToPoint(+stat.value + 10, i, total)
          return [point.x, point.y]
        })
      },
      [total]
    )
    for (let i = 0; i < total; i++) {
      const textPosition = await page().$eval(
        `text:nth-child(${i + 3})`,
        node => [+node.attributes[0].value, +node.attributes[1].value]
      )
      expect(textPosition).toEqual(positions[i])
    }
  }

  // assert each value of stats is correct
// ... (92 more lines)

Domain

Subdomains

Frequently Asked Questions

What does svg.spec.ts do?
svg.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Observer subdomain.
What does svg.spec.ts depend on?
svg.spec.ts imports 3 module(s): e2eUtils.ts, getExampleUrl, setupPuppeteer.
Where is svg.spec.ts in the architecture?
svg.spec.ts is located at test/e2e/svg.spec.ts (domain: VueCore, subdomain: Observer, directory: test/e2e).

Analyze Your Own Codebase

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

Try Supermodel Free