Skip to content

Commit c0cefc0

Browse files
committed
fix(meeting-host): added host location to the meeting details
1 parent 0676ef0 commit c0cefc0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/molecules/meeting-details/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22
import {shape, string} from 'prop-types';
33

4-
export default function MeetingDetails({meeting}) {
4+
export default function MeetingDetails({meeting, host}) {
55
return (
66
<div>
77
<h1>{meeting.date}</h1>
8-
<p>{meeting.time.start} - {meeting.time.end}</p>
8+
<p>{meeting.time.start} - {meeting.time.end} @ {host.location}</p>
99
</div>
1010
);
1111
}
@@ -17,5 +17,8 @@ MeetingDetails.propTypes = {
1717
start: string,
1818
end: string
1919
})
20+
}),
21+
host: shape({
22+
location: string
2023
})
2124
};
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React from 'react';
22
import {shallow} from 'enzyme';
33
import {assert} from 'chai';
4+
import any from '@travi/any';
45
import MeetingDetails from '../../../../src/molecules/meeting-details';
56

67
suite('meeting details', () => {
78
test('that the details are populated from the provided props', () => {
89
const meeting = {date: '2018-03-13', time: {start: '6:00pm', end: '7:00pm'}};
10+
const host = {location: any.sentence()};
911

10-
const wrapper = shallow(<MeetingDetails meeting={meeting} />);
12+
const wrapper = shallow(<MeetingDetails meeting={meeting} host={host} />);
1113

1214
assert.equal(wrapper.find('h1').text(), meeting.date);
13-
assert.equal(wrapper.find('p').text(), `${meeting.time.start} - ${meeting.time.end}`);
15+
assert.equal(wrapper.find('p').text(), `${meeting.time.start} - ${meeting.time.end} @ ${host.location}`);
1416
});
1517
});

0 commit comments

Comments
 (0)