diff --git a/app/components/Peers/index.js b/app/components/Peers/index.js
deleted file mode 100644
index 7d5ab7b6..00000000
--- a/app/components/Peers/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Peers from './Peers'
-
-export default Peers
diff --git a/test/components/Peers.spec.js b/test/components/Peers.spec.js
index d31763ea..465f7d96 100644
--- a/test/components/Peers.spec.js
+++ b/test/components/Peers.spec.js
@@ -1,26 +1,29 @@
import React from 'react'
import { shallow } from 'enzyme'
-import { TiPlus } from 'react-icons/lib/ti'
-import Peers from '../../app/components/Peers'
+import Peers from '../../app/routes/peers/components/Peers'
import PeerModal from '../../app/components/Peers/PeerModal'
import PeerForm from '../../app/components/Peers/PeerForm'
import Peer from '../../app/components/Peers/Peer'
const defaultProps = {
- peersLoading: false,
- peers: [],
+ fetchPeers: () => {},
+ peerFormProps: {
+ form: {},
+ setForm: () => {},
+ connect: () => {}
+ },
+ setPeerForm: () => {},
setPeer: () => {},
+ updateSearchQuery: () => {},
+ disconnectRequest: () => {},
+
peerModalOpen: false,
- peerForm: {},
- setPeerForm: () => {},
- connect: () => {},
- isOpen: false,
- resetPeer: () => {},
- disconnect: () => {},
- form: {},
- setForm: () => {},
- fetchPeers: () => {}
+ filteredPeers: [],
+ peers: {
+ peer: null,
+ searchQuery: ''
+ }
}
const peer = {
@@ -45,15 +48,7 @@ describe('component.Peers', () => {
})
it('should have Peers header, and plus button', () => {
expect(el.contains('Peers')).toBe(true)
- expect(el.find(TiPlus)).toHaveLength(1)
- })
- })
-
- describe('peers are loading', () => {
- const props = { ...defaultProps, peersLoading: true }
- const el = shallow()
- it('should display loading msg', () => {
- expect(el.contains('Loading...')).toBe(true)
+ expect(el.contains('Add new peer')).toBe(true)
})
})
@@ -67,7 +62,7 @@ describe('component.Peers', () => {
})
describe('peer connected', () => {
- const props = { ...defaultProps, peers: [peer] }
+ const props = { ...defaultProps, filteredPeers: [peer] }
const el = shallow()
it('should show peer information', () => {
expect(el.find(Peer)).toHaveLength(1)