return (
<div className="padded">
- {history.map((elt, i) => (
- <React.Fragment key={i}>
- {i > 0 && <hr />}
+ {history.map((elt, historyIndex) => (
+ <React.Fragment key={historyIndex}>
+ {historyIndex > 0 && <hr />}
<div className="padded">
<div className="display-flex-center">
{elt.user.name && (
{elt.type === ReviewHistoryType.Diff && elt.diffs && (
<div className="spacer-top">
- {elt.diffs.map((diff, i) => (
- <IssueChangelogDiff diff={diff} key={i} />
+ {elt.diffs.map((diff, diffIndex) => (
+ <IssueChangelogDiff diff={diff} key={diffIndex} />
))}
</div>
)}
.props();
if (!onChange) {
- return fail("Select's onChange should be defined");
+ fail("Select's onChange should be defined");
+ } else {
+ onChange({ value: HotspotStatusFilter.SAFE });
+ expect(onChangeFilters).toBeCalledWith({ status: HotspotStatusFilter.SAFE });
}
- onChange({ value: HotspotStatusFilter.SAFE });
- expect(onChangeFilters).toBeCalledWith({ status: HotspotStatusFilter.SAFE });
});
it('should trigger onChange for self-assigned toggle', () => {
const { onCheck } = wrapper.find(RadioToggle).props();
if (!onCheck) {
- return fail("RadioToggle's onCheck should be defined");
+ fail("RadioToggle's onCheck should be defined");
+ } else {
+ onCheck(AssigneeFilterOption.ALL);
+ expect(onChangeFilters).toBeCalledWith({ assignedToMe: false });
}
- onCheck(AssigneeFilterOption.ALL);
- expect(onChangeFilters).toBeCalledWith({ assignedToMe: false });
});
it('should trigger onChange for leak period', () => {
.props();
if (!onChange) {
- return fail("Select's onChange should be defined");
+ fail("Select's onChange should be defined");
+ } else {
+ onChange({ value: true });
+ expect(onChangeFilters).toBeCalledWith({ sinceLeakPeriod: true });
}
- onChange({ value: true });
- expect(onChangeFilters).toBeCalledWith({ sinceLeakPeriod: true });
});
function shallowRender(props: Partial<FilterBarProps> = {}) {