Skip to content

Commit

Permalink
Merge 5f08d91 into 2d9565a
Browse files Browse the repository at this point in the history
  • Loading branch information
mucyomiller committed Dec 3, 2019
2 parents 2d9565a + 5f08d91 commit 864b087
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/__tests__/components/request-page/RequestPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,11 @@ describe("<request page />", () => {
wrapper.setProps({ user: {} });
});

it('it should test for the populate request page with props new', () => {
wrapper = shallow(<SingleRequestComponent {...props} />);
wrapper.setProps({ user: {}, match: { params: { id: "new" } } });
});

it('should test for the new request', () => {
props.match.params.id = "new";
wrapper = shallow(<RequestPage {...props} />);
Expand Down Expand Up @@ -697,8 +702,6 @@ describe("<request page />", () => {
});

it('should test for submit a multi city request', () => {
props.match.params.id = "new";

const data = {
request_type: 'OneWay',
location_id: 1,
Expand Down
12 changes: 12 additions & 0 deletions src/__tests__/components/user-requests/UserRequests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import UserRequests, {
} from "../../../components/user-requests/UserRequests";
import successresponse from "../../../__mocks__/__get_user_request_success__.json";
import { fromJS } from "immutable";
import { mapStateToProps } from '../../../components/user-requests/UserRequests';

Enzyme.configure({ adapter: new Adapter() });
const mockedStore = configureStore([thunk]);
Expand Down Expand Up @@ -246,6 +247,17 @@ describe("User Requests View", () => {

select.simulate("change", target);
});

it('test mapstate to props ', () => {
const state = {
Requests: {},
searchRequests: {},
errors: {},
profile: { user: {}}
}

mapStateToProps(state);
});
});
describe("User Requests View mapStateToProps", () => {
it("should cover mapStateToProps errors case in User Requests view", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/single-request/SingleRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class SingleRequest extends Component {
<SideBar userRole={this.state.user.role_value} />
<div className="content-container">
<RequestPage />
{id === "new" ? null : (<Comment requestId={id} owner={this.state.user.id} />)}
</div>
<Footer />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/user-requests/UserRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ export class UserRequests extends Component {
);
}
}
const mapStateToProps = (state) => ({

export const mapStateToProps = (state) => ({
requests: state.Requests,
searchRequests: state.searchRequests,
errors: state.errors,
Expand Down

0 comments on commit 864b087

Please sign in to comment.