Skip to content

Commit 1aefd9b

Browse files
authored
Merge pull request #260 from oslabs-beta/main
Chronos 11
2 parents 5f79b63 + 5b466c9 commit 1aefd9b

File tree

89 files changed

+5842
-7233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5842
-7233
lines changed

CONTRIBUTING.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,24 @@ Chronos welcomes all pull requests.
1414
6. Create a pull request to `master`.
1515

1616
## Getting started
17-
- `npm run bot`: Run Node and Electron at the same time to start Chronos app
18-
- To make changes to codebase on the Main Process
17+
- `npm run dev:app` and `npm run dev:electron`: Run Node and Electron at the same time to start Chronos app
18+
- To make changes to codebase on the Main Process:
1919
- Files in the main process must be compiled prior to starting the app
20-
- In the terminal un Chronos directory, input `tsc` to comile typescript files
21-
- Once compiled, `npm run both`
22-
* Note** If typescript is not installed, `npm install -g typescript`
20+
- In the terminal in Chronos directory, input `tsc` to compile typescript files
21+
- Once compiled, `npm run dev:app` and `npm run dev:electron`
22+
* Note: If typescript is not installed, `npm install -g typescript`
2323

24+
## Chronos Website
25+
26+
The `chronosWebsite` branch holds the code for the website. Edit the website by checking out the branch, modifying the website, and then updating the AWS S3 bucket with the changes.
2427
## Issues
2528

26-
Please do not hesitate to file issues. Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
29+
Please do not hesitate to file issues that detail bugs or offer ways to enhace Chronos.
30+
31+
Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
2732

28-
Please do not hesitate to submit issues that promote bugs or offer ways to enhance to Chronos. When submitting issues, ensure your description is clear and has instructions to be able to reproduce the issue.
33+
When submitting issues, ensure your description is clear and has instructions to be able to reproduce the issue.
2934

30-
## Get in touch
35+
## Get In Touch
3136

32-
We use GitHub as a platform of communication between users and developers to promote transparency. We thrive off of the community support and feedback
37+
We use GitHub as a platform of communication between users and developers to promote transparency, community support and feedback.

README.md

+104-67
Large diffs are not rendered by default.

__tests__/README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
1. React Testing Library versions 13+ require React v18. If your project uses an older version of React, be sure to install version 12
66
```
77
npm install --save-dev @testing-library/react@12
8-
98
```
109
2. install additional packages
1110
```
@@ -55,12 +54,9 @@ module.exports = {
5554

5655
6. use `npm run test` to run jest tests
5756

58-
### Contributing
57+
## Contributing
5958

6059
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
6160

62-
### People
63-
[Snow X. Bai](https://github.com/xueapp)
64-
[Taylor Zhang](https://github.com/taylrzhang)
65-
[Tim Lee](https://github.com/timlee12)
66-
[Roberto Meloni](https://github.com/RobertoRueMeloni)
61+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
62+

__tests__/charts/HealthChart.test.tsx

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

__tests__/charts/LatencyChart.test.tsx

-71
This file was deleted.

__tests__/charts/MemoryChart.test.tsx

-66
This file was deleted.

__tests__/charts/ProcessChart.test.tsx

-75
This file was deleted.

0 commit comments

Comments
 (0)