Skip to content

Commit

Permalink
Merge pull request #35 from oslabs-beta/master
Browse files Browse the repository at this point in the history
Launching version 5.1.0
  • Loading branch information
lu0713 committed Sep 24, 2020
2 parents 6823eff + 6941412 commit 96847a6
Show file tree
Hide file tree
Showing 206 changed files with 39,297 additions and 7,246 deletions.
Empty file added .d.js
Empty file.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
node_modules
.eslintrc.js
.DS_Store
user/settings.json
dist
build
coverage
__tests__/**/__snapshots__
__tests__/**/__snapshots__
release-builds
24 changes: 16 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
language: node_js
node_js:
- "stable"
os:
osx
# jobs:
# allow_failures:
# - os: osx
node_js:
- 'stable'
os: osx
jobs:
# allow_failures:
# - os: osx
fast_finish: true
install:
- npm install
- npm install
script:
npm run test:app
# safelist
# branches:
# only:
# - master
# - middleware
# - chronosWebsite
270 changes: 201 additions & 69 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __tests__/app/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('<App />', () => {
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
it('should render <DashboardContainer /> if not on the first visit', () => {
xit('should render <DashboardContainer /> if not on the first visit', () => {
jest.useFakeTimers();
wrapper = mount(<App />);
jest.runAllTimers;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/app/charts/DockerChart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('React unit tests', () => {
);
});

it('should render', () => {
xit('should render', () => {
expect(wrapper).toMatchSnapshot();
});

Expand Down
35 changes: 0 additions & 35 deletions __tests__/app/components/Applications.test.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/app/components/Copyright.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('React unit test', () => {
mount.cleanUp();
});

it('renders correctly', () => {
xit('renders correctly', () => {
const wrapper = shallow(<Copyright />);
expect(wrapper).toMatchSnapshot();
});
Expand Down
3 changes: 0 additions & 3 deletions __tests__/app/components/Empty.test.tsx

This file was deleted.

40 changes: 14 additions & 26 deletions __tests__/app/components/Home.test.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
import React from 'react';
import { mount } from 'enzyme';
import { createMount, createShallow } from '@material-ui/core/test-utils';

import Home from '../../../app/components/Home';
import { DashboardContext } from '../../../app/context/DashboardContext';


describe('<Home />', () => {
let wrapper: any;
let mount: any;
let shallow: any;

beforeAll(() => {
const applications: any = [];
const getApplications: any = jest.fn();

const mockHome = (
<DashboardContext.Provider value={{ applications, getApplications }}>
<Home />
</DashboardContext.Provider>
);
wrapper = mount(mockHome);
beforeEach(() => {
mount = createMount();
shallow = createShallow();
});

it('should render an <img/> tag of the Chronos pangolin', () => {
const image = wrapper.find('img');
expect(image).toBeDefined();

const imageProps = image.props();
expect(imageProps).toHaveProperty('width');
expect(imageProps).toHaveProperty('height');
expect(imageProps).toHaveProperty('src');
expect(imageProps).toHaveProperty('alt');
afterEach(() => {
mount.cleanUp();
});

it("should render an <h1> tag that says 'Welcome to Chronos!'", () => {
const h1Tag = wrapper.find('h1');
expect(h1Tag.text()).toMatch('Welcome to Chronos!');
it("should render an <p> tag that says 'Your all-in-one application monitoring tool'", () => {
const wrapper = shallow(<Home />);
const pTag = wrapper.find('p');
expect(pTag.text()).toMatch('Your all-in-one application monitoring tool');
});

it("should render a <Link> tag that is labeled 'Get Started'", () => {
const wrapper = shallow(<Home />);
const linkTag = wrapper.find('Link');
expect(linkTag).toBeDefined();
expect(linkTag.text()).toMatch('Get started');
expect(linkTag.text()).toMatch('Get Started');
expect(linkTag.prop('to')).toEqual('/applications');
});
});
53 changes: 0 additions & 53 deletions __tests__/app/components/Occupied.test.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions __tests__/app/containers/GraphsContainer.test.tsx

This file was deleted.

60 changes: 27 additions & 33 deletions __tests__/app/containers/MainContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import React from 'react';
import { configure, shallow, render } from 'enzyme';
import { Route, Switch } from 'react-router-dom';


import MainContainer from '../../../app/containers/MainContainer'
import Home from '../../../app/components/Home'
import Copyright from '../../../app/components/Copyright'
import Occupied from '../../../app/components/Occupied'
import GraphsContainer from '../../../app/containers/GraphsContainer'
import About from '../../../app/components/About'
import MainContainer from '../../../app/containers/MainContainer';
import Home from '../../../app/components/Home';
import Copyright from '../../../app/components/Copyright';
import Occupied from '../../../app/components/Occupied';
import GraphsContainer from '../../../app/containers/GraphsContainer';
import About from '../../../app/components/About';
import Contact from '../../../app/components/Contact';
import Settings from '../../../app/components/Settings';

Expand All @@ -19,42 +18,37 @@ describe('<MainContainer />', () => {
expect(wrapper.contains(<Route exact path="/" component={Home} />)).toBe(true);
});
it('renders component Copyright', () => {
const wrapper = shallow (<MainContainer />);
const wrapper = shallow(<MainContainer />);

expect(wrapper.contains(<Copyright />)).toBe(true);

})
});
it('renders component Occupied', () => {
const wrapper = shallow (<MainContainer />);
const wrapper = shallow(<MainContainer />);

expect(wrapper.contains(<Route exact path="/applications" component={Occupied} />)).toBe(true);
});
it('renders container GraphsContainer', () => {
const wrapper = shallow(<MainContainer />);

})
it('renders container GraphsContainer', () => {
const wrapper = shallow (<MainContainer />);

expect(wrapper.contains(<Route exact path="/applications/:app/:service" component={GraphsContainer} />)).toBe(true);

})
expect(
wrapper.contains(
<Route exact path="/applications/:app/:service" component={GraphsContainer} />
)
).toBe(true);
});
it('renders container About', () => {
const wrapper = shallow (<MainContainer />);

expect(wrapper.contains(<Route path="/about" component={About} />)).toBe(true);
const wrapper = shallow(<MainContainer />);

})
expect(wrapper.contains(<Route exact path="/about" component={About} />)).toBe(true);
});
it('renders container Contact', () => {
const wrapper = shallow (<MainContainer />);

expect(wrapper.contains(<Route path="/contact" component={Contact} />)).toBe(true);
const wrapper = shallow(<MainContainer />);

})
expect(wrapper.contains(<Route exact path="/contact" component={Contact} />)).toBe(true);
});
it('renders container Settings', () => {
const wrapper = shallow (<MainContainer />);

expect(wrapper.contains(<Route path="/settings" component={Settings} />)).toBe(true);
const wrapper = shallow(<MainContainer />);

})

expect(wrapper.contains(<Route exact path="/settings" component={Settings} />)).toBe(true);
});
});


0 comments on commit 96847a6

Please sign in to comment.