Тестирование Axe ios с редукс-thunk (mox ios -jest-фермент) - PullRequest
0 голосов
/ 31 марта 2020

У меня есть действие ( redux-thunk ), и я хочу его протестировать. В действии я использую Ax ios для подключения к базе данных. Как я могу проверить это действие? Это код.

export const signUp = user => dispatch => {
    dispatch(startSubmit('sign-up'));
    return authAPI.signUp(user).then (user => {

        dispatch(setUser(user));

        dispatch(setNotify({open: true, content: 'Some content', type: 
       'success'}));

        dispatch(stopSubmit('sign-up'));

        }).catch(({response: {data}}) => {

        let notification = null;

        if ( data.messageList && data.messageList.length >= 0 ) {
            notification = {content: data.messageList[0], open: true, type: 
            'error'};

            dispatch (setNotify(notification));

            return data.messageList;
        }
        dispatch(stopSubmit('sign-up'));
    })
};

Спасибо)

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...