Skip to content

Commit

Permalink
Fix console log and add a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Oct 2, 2020
1 parent 01ace89 commit a6764f2
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('StepScreenshotDisplayProps', () => {
}));

it('displays screenshot thumbnail when present', () => {
// reactUseSpy.
const wrapper = mountWithIntl(
<StepScreenshotDisplay
checkGroup="check_group"
Expand Down Expand Up @@ -96,6 +95,79 @@ describe('StepScreenshotDisplayProps', () => {
`);
});

it('uses alternative text when step name not available', () => {
const wrapper = mountWithIntl(
<StepScreenshotDisplay checkGroup="check_group" screenshotExists={true} stepIndex={1} />
);

wrapper.update();

expect(wrapper.find('EuiPopover')).toMatchInlineSnapshot(`
<EuiPopover
anchorPosition="rightCenter"
button={
<input
alt="Screenshot"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
src="/api/uptime/journey/screenshot/check_group/1"
style={
Object {
"height": 180,
"objectFit": "cover",
"objectPosition": "center top",
"width": 320,
}
}
type="image"
/>
}
closePopover={[Function]}
display="inlineBlock"
hasArrow={true}
isOpen={false}
ownFocus={false}
panelPaddingSize="m"
>
<EuiOutsideClickDetector
isDisabled={true}
onOutsideClick={[Function]}
>
<div
className="euiPopover euiPopover--anchorRightCenter"
onKeyDown={[Function]}
onMouseDown={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
>
<div
className="euiPopover__anchor"
>
<input
alt="Screenshot"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
src="/api/uptime/journey/screenshot/check_group/1"
style={
Object {
"height": 180,
"objectFit": "cover",
"objectPosition": "center top",
"width": 320,
}
}
type="image"
/>
</div>
</div>
</EuiOutsideClickDetector>
</EuiPopover>
`);
});

it('displays No Image message when screenshot does not exist', () => {
expect(
shallowWithIntl(
Expand Down
5 changes: 1 addition & 4 deletions x-pack/plugins/uptime/public/state/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,4 @@ export const selectedFiltersSelector = ({ selectedFilters }: AppState) => select

export const monitorIdSelector = ({ ui: { monitorId } }: AppState) => monitorId;

export const journeySelector = ({ journeys }: AppState) => {
console.log('journeys', journeys);
return journeys;
};
export const journeySelector = ({ journeys }: AppState) => journeys;

0 comments on commit a6764f2

Please sign in to comment.