Skip to content

Commit 5e27ab4

Browse files
committed
Merge branch 'dev' of https://github.com/oslabs-beta/Docketeer into dev
2 parents 2fb6acc + eec68c8 commit 5e27ab4

19 files changed

+289
-893
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
indent: ['warn', 2],
2828
'no-unused-vars': ['off', { vars: 'local' }],
2929
'prefer-const': 'warn',
30-
quotes: ['warn', 'single'],
30+
'quotes': [2, 'single', { 'avoidEscape': true }],
3131
semi: ['warn', 'always'],
3232
'space-infix-ops': 'warn',
3333
'no-console': 'off',

README.md

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
-->
1313

1414

15+
<div align="center" width="100%">
16+
1517
[![Contributors][contributors-shield]][contributors-url]
1618
[![Forks][forks-shield]][forks-url]
1719
[![Stargazers][stars-shield]][stars-url]
1820
[![Issues][issues-shield]][issues-url]
1921
[![MIT License][license-shield]][license-url]
2022
[![LinkedIn][linkedin-shield]][linkedin-url]
21-
23+
24+
</div>
25+
2226
<!-- PROJECT LOGO -->
2327

2428

@@ -29,7 +33,7 @@
2933
<img src="assets/DockLogo.png" alt="Logo" width="550" height="auto">
3034
</a>
3135
<br />
32-
https://www.docketeer.org/
36+
https://www.docketeer.io/
3337
<br/>
3438

3539
<br />
@@ -57,20 +61,9 @@
5761
<ol>
5862
<br />
5963
<li>
60-
<a href="#about-the-project">About Docketeer</a>
61-
<ul>
62-
<li><a href="#built-with">Built With</a></li>
63-
</ul>
64-
</li>
65-
<li>
66-
<a href="#getting-started">Getting Started</a>
67-
<ul>
68-
<li><a href="#prerequisites">Prerequisites</a></li>
69-
<li><a href="#installation">Installation</a></li>
70-
</ul>
71-
</li>
72-
<li><a href="#usage">Usage</a></li>
73-
<li><a href="#roadmap">Roadmap</a></li>
64+
<a href="#about-the-project">About Docketeer</a></li>
65+
<li><a href="#installation">Installation</a></li>
66+
<li><a href="#in-development">In Development</a></li>
7467
<li><a href="#contributing">Contributing</a></li>
7568
<li><a href="#license">License</a></li>
7669
<li><a href="#authors">Authors</a></li>
@@ -81,6 +74,12 @@
8174

8275
## About The Project
8376

77+
<div align="center" width="100%">
78+
79+
[![Docker][Docker]][Docker-url][![Typescript][TS.js]][TS-url][![JavaScript][JavaScript]][JavaScript-url][![React][React.js]][React-url][![Redux][Redux]][Redux-url][![RTK][RTK]][RTK-url][![Node][Node.js]][Node-url][![Express][Express]][Express-url][![Postgres][Postgres]][Postgres-url][![MySQL][MySQL]][MySQL-url][![Grafana][Grafana]][Grafana-url][![Prometheus][Prometheus]][Prometheus-url][![Helm][Helm]][Helm-url][![Kubernetes][Kubernetes]][Kubernetes-url][![Jest][Jest]][Jest-url][![Vite][Vite]][Vite-url][![Git][Git]][Git-url][![HTML5][HTML5]][HTML5-url][![CSS3][CSS3]][CSS3-url][![SASS][SASS]][SASS-url]
80+
81+
</div>
82+
8483
<br />
8584
<div align="center">
8685
<img src="assets/FullDemo2.gif" alt="Logo" width="fit" height="auto">
@@ -92,17 +91,7 @@ Docketeer is an open source initiative comprising contributions from dozens of t
9291

9392
<p align="right">(<a href="#readme-top">back to top</a>)</p>
9493

95-
### Built With
96-
97-
[![Docker][Docker]][Docker-url][![Typescript][TS.js]][TS-url][![JavaScript][JavaScript]][JavaScript-url][![React][React.js]][React-url][![Redux][Redux]][Redux-url][![RTK][RTK]][RTK-url][![Node][Node.js]][Node-url][![Express][Express]][Express-url][![Postgres][Postgres]][Postgres-url][![MySQL][MySQL]][MySQL-url][![Grafana][Grafana]][Grafana-url][![Prometheus][Prometheus]][Prometheus-url][![Helm][Helm]][Helm-url][![Kubernetes][Kubernetes]][Kubernetes-url][![Jest][Jest]][Jest-url][![Vite][Vite]][Vite-url][![Git][Git]][Git-url][![HTML5][HTML5]][HTML5-url][![CSS3][CSS3]][CSS3-url][![SASS][SASS]][SASS-url]
98-
99-
100-
101-
102-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
103-
104-
105-
#### Features:
94+
### Features:
10695

10796
- Docketeer is a Docker developer tool that's available as an open-source project on GitHub.
10897
- It aims to simplify the development process for projects that use Docker containers.
@@ -118,31 +107,33 @@ Docketeer is an open source initiative comprising contributions from dozens of t
118107

119108
<p align="right">(<a href="#readme-top">back to top</a>)</p>
120109

110+
<!-- INSTALLATION -->
121111

122-
<br />
123-
<div align="center">
124-
<img src="assets/Metrics.gif" alt="Logo" width="fit" height="auto">
125-
</div>
126-
<br />
112+
## Installation
127113

128-
<!-- GETTING STARTED -->
129-
130-
## Getting Started
131-
132-
The local configuration for Docketeer was setup to be as simple as possible for the end-user. Follow the steps below to get started with Docketeer.
133-
134-
<br />
135-
136-
It's super simple to get started! Follow these 3 steps:
114+
The local configuration for Docketeer was setup to be as simple as possible for the end-user. <br />
115+
Follow the steps below to get started with Docketeer.
137116

138117
#### STEP 1 — Clone the repository
139118

140119
```sh
141120
git clone https://github.com/open-source-labs/Docketeer.git
142121
```
143122

123+
#### STEP 1.5 - Need to set up your Kubernetes cluster to work with Docketeer?
124+
125+
Run the following command and then navigate to localhost:3003:
126+
```sh
127+
npm run dev
128+
```
129+
130+
If you haven't set up Prometheus-Operator with us before, click the first button to install.
131+
<br />
132+
Otherwise, you can skip the first button and go on with the next two!
133+
144134
#### STEP 2 — Docker compose up
145135

136+
Go back to your terminal and make sure you're in the Docketeer directory. Then run
146137
```sh
147138
docker compose up
148139
```
@@ -157,11 +148,9 @@ http://localhost:4000/
157148

158149

159150

151+
<!-- IN DEVELOPMENT -->
160152

161-
<!-- ROADMAP -->
162-
163-
## Roadmap
164-
The future of Docketeer?
153+
## In Development
165154

166155
- [ ] Support for more development frameworks and languages, such as Next.JS.
167156
- [ ] Improved support for Docker networking, including more advanced configurations and better integration with other network tools.
@@ -274,9 +263,9 @@ Distributed under the MIT License. See `LICENSE.txt` for more information.
274263

275264
<p align="right">(<a href="#readme-top">back to top</a>)</p>
276265

277-
## Show your support
266+
## Show Your Support
278267

279-
Give a ⭐️ if this project helped you!
268+
Please ⭐️ this project if you found it helpful, thank you!
280269

281270

282271
[contributors-shield]: https://img.shields.io/github/contributors/open-source-labs/Docketeer.svg?style=for-the-badge

__tests__/ContainersTab.test.js

Lines changed: 82 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,118 @@
1-
import React from 'react';
2-
import { Provider } from 'react-redux';
3-
import Containers from '../src/components/Containers/Containers';
4-
import {describe, beforeEach, expect, test, jest} from '@jest/globals';
5-
import '@testing-library/jest-dom';
6-
//import ToggleDisplay from '../src/components/display/ToggleDisplay';
7-
import { fireEvent, render, screen } from '@testing-library/react';
8-
import App from '../src/App';
1+
import React from "react";
2+
import { Provider } from "react-redux";
3+
import Containers from "../src/components/Containers/Containers";
4+
import ContainersCard from "../src/components/ContainersCard/ContainersCard";
5+
import { describe, beforeEach, expect, test, jest } from "@jest/globals";
6+
import "@testing-library/jest-dom";
7+
import { fireEvent, render, screen } from "@testing-library/react";
8+
import fetchMock from "jest-fetch-mock";
9+
import store from "../src/store";
910

1011
const props = {
1112
runningList: [
1213
{
13-
block: '0B/0B',
14-
ID: 'a802306eeac3',
15-
CPUPerc: '0.17%',
16-
MemPerc: '0.11%',
17-
MemUsage: '2.195MiB/1.944GiB',
18-
Name: 'blissful_matsumoto',
19-
NetIO: '796B/0B',
20-
PIDs: '5'
21-
}
14+
block: "0B/0B",
15+
ID: "a802306eeac3",
16+
CPUPerc: "0.17%",
17+
MemPerc: "0.11%",
18+
MemUsage: "2.195MiB/1.944GiB",
19+
Name: "blissful_matsumoto",
20+
NetIO: "796B/0B",
21+
PIDs: "5",
22+
},
2223
],
2324
stoppedList: [
2425
{
25-
Names: 'zealous',
26-
ID: 'c902ec744095',
27-
Image: '84c5f6e03bf0',
28-
RunningFor: '2 days ago',
29-
}
26+
Names: "zealous",
27+
ID: "c902ec744095",
28+
Image: "84c5f6e03bf0",
29+
RunningFor: "2 days ago",
30+
},
3031
],
31-
container: {MemUsage:1},
32+
container: { MemUsage: 1 },
3233
stop: jest.fn(),
3334
remove: jest.fn(),
34-
runStopped: jest.fn()
35+
runStopped: jest.fn(),
36+
status: 'running'
3537
};
3638

39+
fetchMock.enableMocks();
3740

38-
describe('Containers', () => {
39-
beforeEach(async () => {
40-
const app = await render(
41-
<Provider store={store}>
42-
<App />
43-
</Provider>
44-
);
45-
});
46-
47-
beforeEach(()=>{
48-
render(<Containers {...props} />);
41+
describe("Containers", () => {
42+
test("Containers component should render", () => {
43+
render(
44+
<Provider store={store}>
45+
<Containers />
46+
</Provider>
47+
);
48+
});
49+
50+
describe('ContainersCard', () => {
51+
test('renders correctly', () => {
52+
render(
53+
<ContainersCard
54+
containerList={props.runningList}
55+
stopContainer={props.stop}
56+
runContainer={props.runStopped}
57+
removeContainer={props.remove}
58+
status={props.status}
59+
/>
60+
);
61+
});
4962
});
5063

51-
describe('Running List containers', () => {
64+
describe("Running List containers", () => {
65+
beforeEach(() => {
66+
render(<Provider store={store}>
67+
<Containers {...props} />
68+
</Provider>
69+
)
70+
render(
71+
<ContainersCard
72+
containerList={props.runningList}
73+
stopContainer={props.stop}
74+
runContainer={props.runStopped}
75+
removeContainer={props.remove}
76+
status={props.status}
77+
/>
78+
);
79+
});
5280

53-
test('Should have render correct amount of running containers', () => {
54-
const runningContainers = screen.getByText('Running Containers', {exact:false});
55-
const text = runningContainers.innerHTML;
56-
expect(text).toEqual(`Running Containers: ${props.runningList.length}`);
81+
test("Should have render correct amount of running containers", () => {
82+
expect(screen.getByText(/1/i)).toBeInTheDocument();
5783
});
5884

59-
test('Name of container should properly display', ()=>{
60-
const h3 = screen.getAllByRole('heading', { level: 3 });
85+
xtest("Name of container should properly display", () => {
86+
const h3 = div.querySelectorAll(h3);
6187
const name = h3[0].innerHTML;
62-
expect(name).toEqual('blissful_matsumoto');
88+
expect(name).toEqual("blissful_matsumoto");
6389
});
6490

65-
test('Stop button is called', async () => {
66-
const stopButton = document.querySelector('.stop-btn');
91+
xtest("Stop button is called", async () => {
92+
const stopButton = document.querySelector(".stop-btn");
6793
await fireEvent.click(stopButton);
68-
});
69-
70-
test('Toggle Display button works', () => {
71-
render(<ToggleDisplay {...props}/>);
72-
const button = screen.getAllByRole('button');
73-
expect(button[0]).toHaveTextContent('Show Details');
74-
fireEvent.click(button[0]);
75-
expect(button[0]).toHaveTextContent('Hide Details');
76-
expect(button[1]).toHaveTextContent('STOP');
94+
expect(stop).toBeCalled;
7795
});
7896
});
7997

80-
describe('Stopped List Containers', () => {
81-
82-
test('Should have render correct amount of containers', () => {
83-
const exitedContainers = screen.getByText('Exited Containers', {exact:false});
84-
const text = exitedContainers.innerHTML;
85-
expect(text).toEqual(`Exited Containers: ${props.stoppedList.length}`);
98+
describe("Stopped List Containers", () => {
99+
xtest("Should have render correct amount of containers", () => {
100+
expect(div.querySelectorAll("p")[1].textContent).toBe("Count: 1");
86101
});
87102

88-
test('Name of container should properly display', () => {
89-
const name = screen.getAllByText('zealous');
103+
xtest("Name of container should properly display", () => {
104+
const name = screen.getAllByText("zealous");
90105
expect(name).toHaveLength(1);
91106
});
92107

93-
test('Run and remove button should fire', async () => {
94-
const buttons = screen.getAllByRole('button');
108+
xtest("Run and remove button should fire", async () => {
109+
const buttons = screen.getAllByRole("button");
95110
const runButton = buttons[2];
96111
const removeButton = buttons[3];
97112
await fireEvent.click(runButton);
98113
await fireEvent.click(removeButton);
99-
expect(runButton).toBeCalled;
100-
expect(removeButton).toBeCalled;
114+
expect(runStopped).toBeCalled;
115+
expect(remove).toBeCalled;
101116
});
102117
});
103-
});
104-
118+
});

0 commit comments

Comments
 (0)