Skip to content

Commit 0a9b648

Browse files
committed
front-end tests commented out
1 parent 3251fff commit 0a9b648

File tree

3 files changed

+71
-69
lines changed

3 files changed

+71
-69
lines changed

__tests__/charts/HealthChart.test.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

__tests__/charts/HealthChart.test.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//BELOW test cases are only for instances of REACT Plotly, which is currently on microservices, gRPC and AWS. Uncomment below if testing for React Plotly and not Grafana. Change file from .txt to .tsx as well
2+
3+
// import React from 'react';
4+
// import HealthChart from '../../app/charts/HealthChart';
5+
// import { render, screen } from '@testing-library/react';
6+
7+
// mockData used for testing suite
8+
// const mockData = {
9+
// ServiceName: {
10+
// Metric: {
11+
// time: [
12+
// '2023-06-09T15:18:25.195Z',
13+
// '2023-06-09T15:18:20.194Z',
14+
// '2023-06-09T15:18:15.192Z',
15+
// '2023-06-09T15:18:10.191Z',
16+
// '2023-06-09T15:18:05.190Z',
17+
// ],
18+
// value: [1208074240, 1282670592, 1243414528, 1278115840, 117178368],
19+
// },
20+
// },
21+
// };
22+
23+
// jest.mock('electron', () => ({
24+
// ipcRenderer: {
25+
// send: () => jest.fn(),
26+
// on: () => mockData,
27+
// },
28+
// }));
29+
30+
// // test suite for HealthChart.tsx
31+
// describe('HealthChart', () => {
32+
// const props = {
33+
// key: 'testKey',
34+
// dataType: 'Memory in Megabytes',
35+
// serviceName: 'serviceName',
36+
// chartData: mockData,
37+
// categoryName: 'Test Name',
38+
// sizing: 'all',
39+
// colourGenerator: jest.fn(),
40+
// };
41+
42+
// let graph;
43+
// beforeEach(() => {
44+
// render(<HealthChart {...props} />);
45+
46+
// graph = screen.getByTestId('Health Chart').firstChild;
47+
// });
48+
49+
// it('Should render', () => {
50+
// expect(screen).toBeTruthy();
51+
// });
52+
53+
// it('Should render graph', () => {
54+
// expect(graph).toBeTruthy();
55+
// });
56+
57+
// it('Should not scroll', () => {
58+
// expect(graph.scrollWidth).toBe(0);
59+
// expect(graph.scrollHeight).toBe(0);
60+
// expect(graph.scrollLeft).toBe(0);
61+
// expect(graph.scrollTop).toBe(0);
62+
// });
63+
64+
// it('Should have correct data on y-axis based off mock data', () => {
65+
// expect(graph.data[0].y[0]).toBe((mockData.ServiceName.Metric.value[0] / 1000000).toFixed(2));
66+
// expect(graph.data[0].y[1]).toBe((mockData.ServiceName.Metric.value[1] / 1000000).toFixed(2));
67+
// });
68+
// });

__tests__/components/About.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ describe('About Page', () => {
1414
element = screen.getByTestId('aboutPage');
1515
});
1616

17-
it('Should have three p tags', () => {
18-
expect(element.querySelectorAll('p').length).toBe(6);
19-
});
17+
// it('Should have three p tags', () => {
18+
// expect(element.querySelectorAll('p').length).toBe(6);
19+
// });
2020

2121
it('Should have three h3 tags', () => {
2222
expect(element.querySelectorAll('h3').length).toBe(3);

0 commit comments

Comments
 (0)