Skip to content

Commit

Permalink
Merge pull request #74 from nahuelarjonadev/master
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
nahuelarjonadev authored Aug 22, 2019
2 parents add9ffa + ecd40dc commit 863c898
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
4 changes: 3 additions & 1 deletion client/src/app/__tests__/Broker.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ describe('Broker.jsx unit tests', () => {

it('should render <BrokerViews/>', () => {
const instance = wrapper.instance();
expect(instance.state.brokersSnapshots).toEqual([]);
expect(instance.state.brokersSnapshots).toEqual([
{ isAlive: true, brokerId: 5, brokerURI: 'localhost:9092', topics: [] },
]);
wrapper.setState({
brokersSnapshots: [
[
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/__tests__/Message.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Message from '../components/Message';
describe('Message.jsx unit tests', () => {
let wrapper;
const props = {
offset: '5',
offset: 5,
message: 'Test',
};
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/__tests__/MessageList.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('MessageList.js unit tests', () => {

beforeAll(() => {
for (let i = 0; i < 5; i++) {
props.messageArray.push({ offset: i.toString(), value: i.toString() });
props.messageArray.push({ offset: i, value: i.toString() });
}
wrapper = shallow(<MessageList {...props} />);
});
Expand Down
6 changes: 1 addition & 5 deletions client/src/app/__tests__/TopicPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ describe('TopicPage.js unit tests', () => {
it('Should stop loading animation if this.state.messages.lrngth > 0', () => {
wrapper.setState({
loadingData: true,
messages: [
{ offset: '1', value: '1' },
{ offset: '2', value: '2' },
{ offset: '3', value: '3' },
],
messages: [{ offset: 1, value: '1' }, { offset: 2, value: '2' }, { offset: 3, value: '3' }],
});
expect(wrapper.exists('LoadingData')).toBeFalsy();
});
Expand Down
10 changes: 5 additions & 5 deletions client/src/app/__tests__/__snapshots__/MessageList.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ exports[`MessageList.js unit tests Should render without errors 1`] = `
id={0}
key="first-0"
message="0"
offset="0"
offset={0}
/>
<Message
id={1}
key="first-1"
message="1"
offset="1"
offset={1}
/>
<Message
id={2}
key="first-2"
message="2"
offset="2"
offset={2}
/>
<Message
id={3}
key="first-3"
message="3"
offset="3"
offset={3}
/>
<Message
id={4}
key="first-4"
message="4"
offset="4"
offset={4}
/>
</div>
`;
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
"test": "jest",
"test:frontend": "jest client",
"test:backend": "jest main",
"coverage:backend": "jest --collectCoverageFrom=main/kafka/**.js --coverage main",
"package": "",
"build": "electron-packager . Kafka-Lens",
"build-win": "electron-packager . kafka-lens --platform win32 --arch x64 --out dist/",
"setup-win": "electron-installer-windows --src dist/kafka-lens-win32-x64/ --dest dist/installers/",
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=Launch-application",
"package-win": "electron-packager . Kafka-Lens --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=Launch-application --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Kafka Lens\"",
"package-linux": "electron-packager . Kafka-Lens --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=Launch-application"
"coverage:backend": "jest --collectCoverageFrom=main/kafka/*.{js,jsx} --coverage main",
"coverage:frontend": "jest --collectCoverageFrom=client/src/*.{js,jsx} --coverage client"
},
"build": {
"appId": "kafka lens",
Expand All @@ -45,7 +39,6 @@
"dependencies": {
"chart.js": "^2.8.0",
"electron": "^4.2.9",
"jest-css-modules-transform": "^2.1.1",
"kafka-node": "^4.0.1",
"node-sass": "^4.11.0",
"node-zookeeper-client": "^1.0.0",
Expand Down Expand Up @@ -80,6 +73,7 @@
"eslint-plugin-react-hooks": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.1.0",
"jest-css-modules-transform": "^2.1.1",
"prettier": "^1.18.2",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
Expand Down

0 comments on commit 863c898

Please sign in to comment.