Skip to content

Commit ef4e128

Browse files
authored
Merge pull request #59 from oslabs-beta/staging
Staging
2 parents 58481d2 + 4dd2b0d commit ef4e128

15 files changed

+19
-18
lines changed

src/app/__tests__/actionContainer.test.js renamed to src/app/__tests__/ActionContainer.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useStoreContext } from '../store';
88
import { emptySnapshots } from '../actions/actions';
99
import Action from '../components/Action';
1010

11+
1112
configure({ adapter: new Adapter() });
1213

1314
const state = {

src/app/__tests__/ButtonsContainer.test.js renamed to src/app/__tests__/ButtonsContainer.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('testing the bottom buttons', () => {
6565
});
6666
});
6767

68-
6968
describe('lock button testing', () => {
7069
beforeEach(() => {
7170
wrapper.find('.lock-button').simulate('click');
@@ -106,4 +105,4 @@ describe('testing the bottom buttons', () => {
106105
expect(wrapper.find('.persist-button').text()).toBe('Unpersist');
107106
});
108107
});
109-
});
108+
});

src/app/__tests__/Chart.test.jsx renamed to src/app/__tests__/Chart.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import React from 'react';
66
import { configure, mount } from 'enzyme';
77
import Adapter from 'enzyme-adapter-react-16';
8-
import Chart from '../components/Chart';
8+
const Chart = require('../components/Chart').default;
9+
910
// Unit test cases for d3 functionality
1011
configure({ adapter: new Adapter() });
1112
// Test the life cycle methods in Chart

src/app/__tests__/Diff.test.jsx renamed to src/app/__tests__/Diff.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { configure, shallow } from 'enzyme';
33
import Adapter from 'enzyme-adapter-react-16';
4-
import Diff from '../components/Diff.jsx';
4+
const Diff = require('../components/Diff').default;
55

66
import { useStoreContext } from '../store';
77

@@ -19,21 +19,21 @@ describe('Unit testing for Diff.jsx', () => {
1919
}],
2020

2121
}],
22-
}
22+
};
2323

2424
const state = {
2525
currentTab: 100,
2626
tabs: { 100: { snapshots: [1, 2, 3, 4], viewIndex: 1, sliderIndex: 1 } },
2727
};
2828

29-
3029
useStoreContext.mockImplementation(() => [state]);
3130

3231
const delta = { children: {} }; // expect delta to be an obj
3332
const html = 'html'; // expect html to be a string
3433
const previous = { state: 'string', children: {} }; // expect previous to be an obj
3534

3635
beforeEach(() => {
36+
// eslint-disable-next-line react/jsx-props-no-spreading
3737
wrapper = shallow(<Diff {...props} />);
3838
});
3939

@@ -69,5 +69,4 @@ describe('Unit testing for Diff.jsx', () => {
6969
expect(wrapper.textContent).not.toEqual('No state change detected. Trigger an event to change state');
7070
});
7171
});
72-
7372
});

src/app/__tests__/DiffRoute.test.jsx renamed to src/app/__tests__/DiffRoute.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import Adapter from 'enzyme-adapter-react-16';
44
import {
55
MemoryRouter as Router, Route, NavLink, Switch,
66
} from 'react-router-dom';
7-
8-
import DiffRoute from '../components/DiffRoute.jsx';
7+
const DiffRoute = require('../components/DiffRoute').default;
98

109
const props = {
1110
snapshot: [{}],

src/app/__tests__/SwitchApp.test.jsx renamed to src/app/__tests__/SwitchApp.test.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ import React from 'react';
22
import Select from 'react-select';
33
import { configure, shallow } from 'enzyme';
44
import Adapter from 'enzyme-adapter-react-16';
5-
import SwitchApp from '../components/SwitchApp.jsx';
5+
import SwitchApp from '../components/SwitchApp';
66

77
import { useStoreContext } from '../store';
88

99
configure({ adapter: new Adapter() });
1010

1111
jest.mock('../store');
1212

13-
1413
describe('Unit testing for SwitchApp.jsx', () => {
1514
let wrapper;
1615

1716
const state = {
1817
currentTab: 100,
19-
tabs: { 100: { snapshots: [1, 2, 3, 4], viewIndex: 1, sliderIndex: 1, title: 'component'} },
18+
tabs: {
19+
100: {
20+
snapshots: [1, 2, 3, 4], viewIndex: 1, sliderIndex: 1, title: 'component',
21+
},
22+
},
2023
};
2124
const dropdownCurrTabLabel = {
2225
value: 100,
@@ -45,7 +48,7 @@ describe('Unit testing for SwitchApp.jsx', () => {
4548
});
4649
it('OnChange should run dispatch function', () => {
4750
expect(dispatch.mock.calls.length).toBe(1);
48-
})
51+
});
4952
it('options prop should be an array', () => {
5053
expect(Array.isArray(wrapper.find('.tab-select-container').props().options)).toBeTruthy();
5154
expect(wrapper.find('.tab-select-container').props().options[0]).toHaveProperty('value');

0 commit comments

Comments
 (0)