Skip to content

Commit

Permalink
Updating tests to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
deniolp committed Nov 27, 2019
1 parent c31a04a commit c345e0f
Show file tree
Hide file tree
Showing 54 changed files with 98 additions and 413 deletions.
6 changes: 3 additions & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import axios from 'axios';
import {ActionCreator} from './reducer/reducer';

let api;
const createAPI = (dispatch) => {
const createAPI = (dispatch): object => {
api = axios.create({
baseURL: `https://htmlacademy-react-2.appspot.com/wtw`,
timeout: 5000,
withCredentials: true,
});

const onSuccess = (response) => response;
const onSuccess = (response): object => response;

const onFail = (error) => {
const onFail = (error): void => {
if (error.response.status === 401) {
dispatch(ActionCreator.authorizeUser({}));
dispatch(ActionCreator.changeIsAuthorizationRequired(true));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import renderer from 'react-test-renderer';
import * as React from 'react';
import * as renderer from 'react-test-renderer';
import {BrowserRouter} from 'react-router-dom';
import {Provider} from 'react-redux';
import thunk from 'redux-thunk';
Expand Down Expand Up @@ -29,7 +29,6 @@ describe(`AddReview`, () => {
it(`renders correctly`, () => {
const tree = renderer.create(
<BrowserRouter><Provider store={store}><AddReview
isAuthorizationRequired={false}
match={{
params: {
id: 1,
Expand Down
330 changes: 0 additions & 330 deletions src/components/app/__snapshots__/app.test.js.snap

This file was deleted.

7 changes: 7 additions & 0 deletions src/components/app/__snapshots__/app.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`App renders correctly 1`] = `
<h1>
Fee
</h1>
`;
Loading

0 comments on commit c345e0f

Please sign in to comment.