Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Migrate do_verify_email to Redux #338

Merged
merged 27 commits into from
Dec 14, 2017

Conversation

avasconcelos114
Copy link
Contributor

Summary

Converts the do_verify_email.jsx component to utilize Redux, and adds a few component tests

Ticket Link

mattermost/mattermost#7784

Checklist

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed
  • Added or updated unit tests (required for all new features)

**Should wait until enzyme & react version issues are resolved**
**Should wait until enzyme & react version issues are resolved**
**Should wait until enzyme & react version issues are resolved**
* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
@jasonblais jasonblais added the 2: Dev Review Requires review by a core commiter label Nov 21, 2017
Copy link
Member

@jwilander jwilander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks pretty good, got a few comments though

verifyEmail = async () => {
const {actions: {verifyUserEmail}} = this.props;
const {data, error} = await verifyUserEmail(this.props.location.query.token);
let serverError;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor, but it looks like serverError is only used in the else if, mind moving the declaration inside there?


import DoVerifyEmail from './do_verify_email.jsx';

const mapStateToProps = createSelector(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the selector really needed here? Also it's not returning any props so won't you be losing the location prop? Let me know if I'm missing something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right about the selector not being needed. What I was wondering about this particular component though, is that it seems to only be called through a link in a verification mail, rather than by a parent component (likely then getting its location prop through parameters given in the link).

It seems like the mapStateToProps function is required by connect(), so I wasn't sure what was the best course of action for a component that only needed the mapDispatchToProps.
Would the following be the right way to do it then?

function mapStateToProps(state, ownProps) {
    return ownProps;
}

const requiredProps = {
location: {
query: '',
token: ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? It looks like token should be nested in query per this access above this.props.location.query.token

};
}

export default connect(mapStateToProps, mapDispatchToProps)(DoVerifyEmail);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this won't subscribe to the store, it can be like:

export default connect(null, mapDispatchToProps)(DoVerifyEmail);


import Adapter from 'enzyme-adapter-react-16';

import {verifyUserEmail as VerifyUserMail} from 'mattermost-redux/actions/users';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggests not to import this and would recommend only doing the mockup of props.verifyUserEmail.

Would prefer to have tests as well for:

instance.componentWillMount();

// small delay needed to wait for async function (fails test otherwise)
setTimeout(function() {
Copy link
Member

@saturninoabril saturninoabril Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setTimeout can be avoided here by:

  • adding async like test('should run verifyUserEmail action & display error message', async () => {
  • adding mockup to verifyUserEmail (e.g. requiredProps.actions.verifyUserEmail = jest.genMockFunction().mockImplementation(...))

Please see EditOAuthApp component test for your reference.

query: {
token: '',
email: ''
}
Copy link
Member

@saturninoabril saturninoabril Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would recommend to add values here (e.g. {token: 'token', email: '[email protected]'}), so we could do assertions like:

  • expect(requiredProps.actions.verifyUserEmail).toHaveBeenCalledWith('token');
  • expect(browserHistory.push).toHaveBeenCalledWith('/login?extra=verified&email=test%40test.com');

@jwilander
Copy link
Member

@avasconcelos114, let us know if you have any questions or need any help :)

**Should wait until enzyme & react version issues are resolved**
**Should wait until enzyme & react version issues are resolved**
**Should wait until enzyme & react version issues are resolved**
* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Work in Progress, last two tests returning errors.
@avasconcelos114
Copy link
Contributor Author

avasconcelos114 commented Nov 27, 2017

EDIT: Oh god my commit was a mess after I rebased to the newest master, any guidance on how not to make this mistake again would also be greatly appreciated 😞
Yeah sadly I need help again :(

I figured it's best to make another commit given that my issue is with various parts of the do_verify_email.test.jsx file.

As (apparently) Promises with no reject will soon be deprecated (I keep seeing warning messages about it), I've made a few changes to the original mock function seen in edit_oauth_app.test.jsx. (The problems occur even when I use the exact same code as edit_oauth_app.test.jsx, but I'm just explaining why it looks different).

The issue is that I'm getting errors in the last two tests that involve the aforementioned Promises, yet I can't seem to find the cause of it. Running npm test do_verify_email.test.jsx gives me the following errors:

● components/DoVerifyEmail › should reject verifyUserEmail action & display error message

TypeError: Cannot read property 'data' of undefined

● components/DoVerifyEmail › should resolve verifyUserEmail & push value to browserHistory
Failed: [object Object]

Been looking over everything and just can't seem to find what's causing these, some guidance would be very much appreciated :(

* Object with validation parameters given in link
*/
location: PropTypes.object.isRequired
}
Copy link
Member

@saturninoabril saturninoabril Nov 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you forgot below. That might also be one of the reason why your test (patterned to EditOAuthApp) is not working properly.

        actions: PropTypes.shape({
            verifyUserEmail: PropTypes.func.isRequired
        }).isRequired

}

verifyEmail = async () => {
const {actions: {verifyUserEmail}} = this.props;
const {data, error} = await verifyUserEmail(this.props.location.query.token);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know why but this is not playing nicely with the test. It works fine though with below code but I'm 0/5 if it's a good pattern:

        const verify = await verifyUserEmail(this.props.location.query.token);

       if (!verify) {
            // something wrong happened
        }else if (verify.data) {
            ...
        } else if (verify.error) {
            ...
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else you mentioned worked really well. Thank you for the help.

but regarding this part, I tried to see if maybe there was a better pattern to use, and the best I could come up with ended up being:

const verify = await verifyUserEmail(this.props.location.query.token);

        if (verify && verify.data) {
            browserHistory.push('/login?extra=verified&email=' + encodeURIComponent(this.props.location.query.email));
        } else if (verify && verify.error) {
            const serverError = (
                <FormattedMessage
                    id='signup_user_completed.invalid_invite'
                    defaultMessage='The invite link was invalid.  Please speak with your Administrator to receive an invitation.'
                />
            );
            this.setState({
                verifyStatus: 'failure',
                serverError
            });
        }

Which isn't too different than what you showed.

I'll keep trying to find a possibly better pattern for this, let me know what you think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'm good with it.

<LoadingScreen
position="relative"
/>
`;
Copy link
Member

@saturninoabril saturninoabril Nov 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add snapshots test for

  • when state.verifyStatus is 'pending' and,
  • when state.serverError is not null.

},
actions: {verifyUserEmail: jest.fn()}
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add:

    global.window.mm_config = {};
    
    beforeEach(() => {
        global.window.mm_config.SiteName = 'Mattermost';
    });

    afterEach(() => {
        global.window.mm_config = {};
    });


test('should reject verifyUserEmail action & display error message', async () => {
const error = true;
requiredProps.actions.verifyUserEmail = jest.genMockFunction().mockImplementation(
Copy link
Member

@saturninoabril saturninoabril Nov 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once action is added at DoVerifyEmail, below should work

        requiredProps.actions.verifyUserEmail = jest.genMockFunction().mockImplementation(
            () => {
                return new Promise((resolve) => {
                    process.nextTick(() => resolve(requestError));
                });
            }
        );

Then, process.nextTick(() => resolve(requestSuccess)); to next test.

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Code Review Fixes


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Fixed test errors


Fix test name


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me now except for last minor change request.

Not sure what happened to your branch and I'm not sure how to fix it. Consider this approve from me once your branch is cleared. Thanks!

import {shallow, configure} from 'enzyme';
import {browserHistory} from 'react-router';

import Adapter from 'enzyme-adapter-react-16';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this last bit from me. I don't think this is needed here since it's already setup here: https://github.com/mattermost/mattermost-webapp/blob/master/tests/setup.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty, so just to confirm, before getting this branch approved I need to:

  1. Remove import Adapter from 'enzyme-adapter-react-16'; as it's already been setup in a previous merge
  2. Clear up my branch

By clearing up my branch you mean that mess of commits/files changed right? I'm not quite sure what happened, they somehow got included as if they were my commits every time I rebased to the newest master, a bit frustrating but I'll look for ways to fix it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't been having much luck with finding a solution for clearing up all those commits and modified files...

Wondering if starting a new branch/pull request would provide a 'cleaner' solution to fixing this up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I temporarily changed the base branch then backed again to master, and it looked like the commits are now cleaner.

@saturninoabril saturninoabril changed the base branch from master to release-4.5 December 11, 2017 13:01
@saturninoabril saturninoabril changed the base branch from release-4.5 to master December 11, 2017 13:01
@saturninoabril
Copy link
Member

@avasconcelos114 Sorry for the inconvenience but could you give this a rebase to latest master (with fix to our build system)? Thanks!

@jwilander jwilander added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Dec 13, 2017
**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Code Review Fixes


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Fixed test errors


Fix test name


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Remove useless Adapter import in test


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
@avasconcelos114 avasconcelos114 changed the base branch from master to release-4.5 December 14, 2017 01:14
@avasconcelos114 avasconcelos114 changed the base branch from release-4.5 to master December 14, 2017 01:14
@saturninoabril saturninoabril merged commit c168878 into mattermost:master Dec 14, 2017
saturninoabril pushed a commit that referenced this pull request Dec 14, 2017
* Migrate create_post component to redux
 Remove channelId and channel from state as it is avaialable via props.
 Remove Team store dependency.
 Remove User store dependency
 Remove Preferences store dependency.
  * Remove preferences from store as props change trigger render.
  * Add selector for preferences
 Move REACTION_PATTERN to utils.
 Remove message_history_store dependency.
 Add redux post actions instead of flux actions.
 Change bind functions to class prop arrow functions.
 Add proptype comments.
 Remove couple of unused variables.
* Remove all bind functions.
* Add MESSAGE_TYPES constants.
Remove few postStore dependent functions.
Add getCurrentUsersLatestPostId redux state selector.
Add Test cases for create_post
Remove uploadInprogress and filesInfo from state
Remove unused variable from file_preview which causes mutation on props.
Fix sort on filesInfo for file_preview component.
Fix draft constant
Remove postStore dependecy.
Add edit dispatch from redux.
Add test cases
Fix failing snapshots.

* Fix review comments

* Fix member count in render for notifying user on @ALL

* Fix test cases
 Change currentChannelMembersCount default value to 1 as user is part of the channel.

* Fix for the value getCurrentChannelStats as on team creation and thread creation it is undefined.

* Adds inline make documentation and 'help' command. (#394)

* Fix atmention to check for user on users object only (#419)

* PLT-8237 - Updating modal textarea overflow (#414)

* [PLT-6940] Add webrtc call at channel navbar and make it available on narrow window (#17)

* add webrtc call at channel navbar and make it available on narrow window

* rebase

* updated and add unit tests

* update snapshot

* [PLT-8222] Add 100% height to root and fix setState warning on ManageLanguage component (#409)

* add 100% height to root and fix setState warning on ManageLanguage component

* update #root class and move other logics of LoggedIn to componentDidMount

* remove setState call on success updateUser

* add channelId to RECEIVED_POSTS action after edit (#424)

* Add deactivated users to dm modal (#401)

* add deactivated users to dm modal

* address pr comments

* Create NOTICE.txt (#376)

* Create NOTICE.txt

* Changed react to react-dom

* Update mattermost-redux to 1.1.0 (#417)

* Use CMD instead of CTRL for textbox focusing on Mac (#407)

* PLT-8236 Properly highlight at mentions for the current user which are followed by punctuation (#405)

* Reset post viewed count when switching channels (#373)

* Upgrade WebRTC client driver (#383)

* PLT-8170: Fix channel name / purpose modals (#416)

* fix channel name / purpose modals

* update snapshots

* another snapshot update

* Fixing LDAP nickname setting block. (#403)

* Remove hard-coded link to System Console stats docs (#393)

* Update system_analytics.jsx

* Update en.json

* Note that desktop notification duration is a max of 5 seconds for desktop apps (#362)

* Update desktop_notification_settings.jsx

* Update en.json

* Add Config to disable Auth Transfers. Remove frontend switch to email and password. (#328)

* remove the video call from the his own DM channel (#411)

* Backward compatible fix theme.mentionBg typo (#322)

* Backward compatible fix theme.mentionBg typo

* Save mentionBj with mentionBg

* Fix styling

* PLT-8292 - Updating webrtc button (#415)

* PLT-8292 - Updating webrtc button

* Updating webrtc conditional

* Add pluggable component in mobile channel header (#412)

* Add pluggable component in mobile channel header

* Fix styling

* Update snapshot

* Fix mobile view search button (#408)

* unit tests for AccessHistoryModal and ActivityLogModal (#413)

* remove unused type arg of UserActions.updateUser and remove unused/unnecessary Constants.UserUpdateEvents (#410)

* Create comment use the component state to show/edit the draft (#395)

* translations PR 20171204 (#402)

* Hide locale setting if there's a single locale available (#330)

* UCHAT-275 Add config option to hide locale setting

* Hide locale setting if there's a single locale available Ex: AvailableLocales: en

* PLT-8321: simplify isXVisible callsites (#428)

* simplify isXVisible callsites

* update package.json

* PLT-8198: System Console updates for message/compliance export (#390)

* Updated the text on the System Console settings page to approved copy

* Language fixes from the PR

* More text updates

* Removed export location setting from the UI

* Fixed style

* Fixed bug preventing user from enabling/disabling compliance export

* PLT-8198: System Console updates for message/compliance export (#390)

* Updated the text on the System Console settings page to approved copy

* Language fixes from the PR

* More text updates

* Removed export location setting from the UI

* Fixed style

* Fixed bug preventing user from enabling/disabling compliance export

(cherry picked from commit a9107f3)

* Update NOTICE.txt (#426)

* Avoid creating a new EmojiMap for each post (#431)

* Avoid creating a new EmojiMap for each post

* Removed debug message

* fix js error in dm add user modal (#437)

* Allow deactivation of SSO users (#423)

* Update jenkinsfile (#444)

* add test to AccountSettingsDisplay modal (#440)

* change inline arrow function in ref (#449)

* Fix jenkinsfile s3 push (#452)

* Fix typo in audit table component (#427)

* Fix typo in audit table component

* Updating i18n strings as well, as requested

* Added PostMarkdown component (#404)

* Added PostMarkdown component

* Fixed failing tests

* Fixing styles

* add unit test to AddUsersToTeam and fix function/unused codes (#420)

* Remove div container taking up width (#425)

this blocks users from clicking messages directly behind the NewMessageIndicator compnent

* Fix mutation on draft file remove

* Migrate do_verify_email to Redux (#338)

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display

* Code Review Fixes

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**

* Fix Tests

* Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display

* Code Review Fixes

* WIP: Changes to testing

Work in Progress, last two tests returning errors.

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Code Review Fixes


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Fixed test errors


Fix test name


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784

* Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
Code Review Fixes


Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Migrate do_verify_email to Redux

**Should wait until enzyme & react version issues are resolved**
Fix Tests


Finalized component tests

* Snapshot test
* verifyEmail function test
* Test mattermost-redux action & error display
WIP: Changes to testing

Work in Progress, last two tests returning errors.
Code Review Fixes


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Fixed test errors


Fix test name


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Remove useless Adapter import in test


Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784
Merge remote-tracking branch 'avasconcelos114/PLT-7784' into PLT-7784

* Fix merge issue

* Migrate create_post component to redux
 Remove channelId and channel from state as it is avaialable via props.
 Remove Team store dependency.
 Remove User store dependency
 Remove Preferences store dependency.
  * Remove preferences from store as props change trigger render.
  * Add selector for preferences
 Move REACTION_PATTERN to utils.
 Remove message_history_store dependency.
 Add redux post actions instead of flux actions.
 Change bind functions to class prop arrow functions.
 Add proptype comments.
 Remove couple of unused variables.
* Remove all bind functions.
* Add MESSAGE_TYPES constants.
Remove few postStore dependent functions.
Add getCurrentUsersLatestPostId redux state selector.
Add Test cases for create_post
Remove uploadInprogress and filesInfo from state
Remove unused variable from file_preview which causes mutation on props.
Fix sort on filesInfo for file_preview component.
Fix draft constant
Remove postStore dependecy.
Add edit dispatch from redux.
Add test cases
Fix failing snapshots.

* Fix review comments

* Fix member count in render for notifying user on @ALL

* Fix test cases
 Change currentChannelMembersCount default value to 1 as user is part of the channel.

* Fix for the value getCurrentChannelStats as on team creation and thread creation it is undefined.

* Fix mutation on draft file remove
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Dec 15, 2017
@jasonblais jasonblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jan 4, 2018
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
* auto-close archived dms

* update getSortedDirectChannelIds
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
* auto-close archived dms

* update getSortedDirectChannelIds
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants