Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #192 from codaco/fix/prop-type
Browse files Browse the repository at this point in the history
Fix addresses displayed in Instructions
  • Loading branch information
bryfox committed Nov 16, 2018
2 parents 1ca8595 + 13c625f commit 35bd0c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/renderer/components/Instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const Instructions = ({ compact, apiInfo, showPairingInstructions, showImportIns
you may enter the connection information manually:</em>
</p>
<dl className="instructions__definition-list">
<dt>Address</dt>
<dd>{apiInfo.address}</dd>
<dt>Addresses</dt>
<dd>{apiInfo.publicAddresses.join(', ')}</dd>
<dt>Port</dt>
<dd>{apiInfo.httpPort}</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/__tests__/Instructions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('<Instructions />', () => {
});

it('renders API info', () => {
const apiInfo = { address: '192.168.x.x', httpPort: 65531 };
const apiInfo = { publicAddresses: ['192.168.x.x'], httpPort: 65531 };
const subject = shallow(<Instructions apiInfo={apiInfo} />);
expect(subject.text()).toMatch(apiInfo.address);
expect(subject.text()).toMatch(apiInfo.publicAddresses[0]);
expect(subject.text()).toMatch(apiInfo.httpPort.toString());
});
});
2 changes: 1 addition & 1 deletion src/renderer/containers/__tests__/OverviewScreen-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('<OverviewScreen />', () => {
const state = {
devices: [{ id: 'device1', name: '1', createdAt: new Date() }],
protocols: [{ id: 'protocol1', name: '1', createdAt: new Date() }],
connectionInfo: { deviceService: { httpPort: 5555, address: '192.168.x.x' } },
connectionInfo: { deviceService: { httpPort: 5555, publicAddresses: ['192.168.x.x'] } },
};
let store;
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/types.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';

const deviceApiInfo = PropTypes.shape({
address: PropTypes.string.isRequired,
publicAddresses: PropTypes.arrayOf(PropTypes.string).isRequired,
httpPort: PropTypes.number.isRequired,
});

Expand Down

0 comments on commit 35bd0c9

Please sign in to comment.