Home Forums Chart Support יצירת קובץ בדיקות

יצירת קובץ בדיקות

Viewing 2 posts - 1 through 2 (of 2 total)
  • #45807

    :זה בהדיקה שלי
    import React from ‘react’;
    import { render } from ‘@testing-library/react’;
    import BaseGraph from ‘./BaseGraph’;

    describe(‘BaseGraph Component’, () => {
    let originalWindow:any;

    beforeAll(() => {

    originalWindow = { …window };
    Object.defineProperty(window, ‘crypto’, {
    value: {
    getRandomValues: () => new Uint32Array(10) // Mocking getRandomValues for crypto object
    }
    });
    });

    it(‘should render without crashing’, () => {
    render(<BaseGraph animationEnabled={true} theme=”light1″ text=”adfsgf” type=”column” dataPoints={[
    { x: 10, y: 71 },
    { x: 20, y: 55 },
    { x: 30, y: 50 },
    { x: 40, y: 65 },
    { x: 50, y: 71 },
    { x: 60, y: 68 },
    { x: 70, y: 38 },
    { x: 80, y: 92 },
    { x: 90, y: 54 },
    { x: 100, y: 60, indexLabel: ‘high!’ },
    { x: 110, y: 21 },
    { x: 120, y: 49 },
    { x: 130, y: 36 },
    ]}/>);
    });
    });
    ואני מקבלץ שגיאה כזו:
    TypeError: Cannot read properties of null (reading ‘webkitBackingStorePixelRatio’)
    ❯ Na node_modules/@canvasjs/charts/canvasjs.min.js:36:25
    ❯ va node_modules/@canvasjs/charts/canvasjs.min.js:39:26
    ❯ new m node_modules/@canvasjs/charts/canvasjs.min.js:138:458
    ❯ CanvasJSChart.componentDidMount node_modules/@canvasjs/react-charts/canvasjs.react.js:33:16
    31| componentDidMount() {
    32| //Create Chart and Render
    33| this.chart = new CanvasJS.Chart(this.containerRef.current, this.options);
    | ^
    איך אפשר לטפל בזה?

    #45813

    @estypwolak,

    Charts seems to be working fine & we are unable to reproduce the issue that you have mentioned above. Can you kindly create sample project and share it with us over Google-Drive or Onedrive so that we can run it locally at our end, understand the scenario better and help you out?

    __
    Sachin Bisht
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.