Skip to content

Commit

Permalink
Fix (Log): show request mock response when available
Browse files Browse the repository at this point in the history
  • Loading branch information
morsdyce committed Mar 16, 2017
1 parent fd0707e commit 638ecd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ui/components/RequestLogs/RequestRow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import styled from 'styled-components';
import find from 'lodash/find';
import get from 'lodash/get';
import API from 'api';
import UIState from 'ui/states/UIState';
import MocksState from 'ui/states/MocksState';
Expand Down Expand Up @@ -61,7 +62,7 @@ const editRequest = (request) => (event) => {
const matchingMocks = API.getMatchingMocks(request);
const activeMock = find(matchingMocks, { isActive: true });
const disabledMock = find(matchingMocks, { isActive: false });

const mock = activeMock || disabledMock || API.mockRequest(request);

MocksState.selectItems([mock]);
Expand Down Expand Up @@ -112,7 +113,7 @@ const RequestRow = ({ request, onSelect, selected, getCellWidth, query }) => (
</Cell>

<Cell>
{ request.response.body }
{ get(request, 'mock.response.body', request.response.body) }
</Cell>

{
Expand All @@ -125,4 +126,4 @@ const RequestRow = ({ request, onSelect, selected, getCellWidth, query }) => (
</Container>
);

export default RequestRow;
export default RequestRow;

0 comments on commit 638ecd8

Please sign in to comment.