Updated styles in javascript to fulfill adidas rules

This commit is contained in:
Alejandro Celaya
2018-08-25 23:39:27 +02:00
parent ed0aa68452
commit 6a016d8e6f
70 changed files with 1250 additions and 759 deletions

View File

@@ -1,7 +1,7 @@
import { shallow } from 'enzyme'
import React from 'react'
import AsideMenu from '../../src/common/AsideMenu'
import { shallow } from 'enzyme';
import React from 'react';
import { NavLink } from 'react-router-dom';
import AsideMenu from '../../src/common/AsideMenu';
describe('<AsideMenu />', () => {
let wrapped;
@@ -15,9 +15,10 @@ describe('<AsideMenu />', () => {
it('contains links to different sections', () => {
const links = wrapped.find(NavLink);
const expectedLength = 3;
expect(links).toHaveLength(3);
links.forEach(link => expect(link.prop('to')).toContain('abc123'));
expect(links).toHaveLength(expectedLength);
links.forEach((link) => expect(link.prop('to')).toContain('abc123'));
});
it('contains a button to delete server', () => {

View File

@@ -1,16 +1,18 @@
import React from 'react';
import { shallow } from 'enzyme';
import DateInput from '../../src/common/DateInput';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import moment from 'moment';
import DateInput from '../../src/common/DateInput';
describe('<DateInput />', () => {
let wrapped;
const createComponent = (props = {}) => {
wrapped = shallow(<DateInput {...props} />);
return wrapped;
};
afterEach(() => {
if (wrapped !== undefined) {
wrapped.unmount();

View File

@@ -2,17 +2,21 @@ import { shallow } from 'enzyme';
import { values } from 'ramda';
import React from 'react';
import * as sinon from 'sinon';
import { Home } from '../../src/common/Home';
import { HomeComponent } from '../../src/common/Home';
describe('<Home />', () => {
let wrapped;
const defaultProps = {
resetSelectedServer: () => {},
resetSelectedServer() {
return '';
},
servers: {},
};
const createComponent = props => {
const createComponent = (props) => {
const actualProps = { ...defaultProps, ...props };
wrapped = shallow(<Home {...actualProps} />);
wrapped = shallow(<HomeComponent {...actualProps} />);
return wrapped;
};
@@ -42,7 +46,7 @@ describe('<Home />', () => {
const servers = {
1: { name: 'foo', id: '123' },
2: { name: 'bar', id: '456' },
}
};
const wrapped = createComponent({ servers });
expect(wrapped.find('Link')).toHaveLength(0);