* Moved SelectServer view state into store * Moved view state for Login to stores * Renamed RequestStatus values * Merged duplicated view state for login * initial redux store * Fix eslint * user store and force logout when necessary * channel store * address feedback * Revert naming the property of data
33 lines
1,007 B
JavaScript
33 lines
1,007 B
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import assert from 'assert';
|
|
|
|
import * as Actions from 'actions/views/login';
|
|
import configureStore from 'store/configureStore';
|
|
|
|
describe('Actions.Views.Login', () => {
|
|
it('handleLoginIdChanged', (done) => {
|
|
const store = configureStore();
|
|
|
|
store.subscribe(() => {
|
|
const loginId = store.getState().views.login.loginId;
|
|
assert.equal('email@example.com', loginId);
|
|
done();
|
|
});
|
|
|
|
Actions.handleLoginIdChanged('email@example.com')(store.dispatch, store.getState);
|
|
});
|
|
|
|
it('handlePasswordChanged', (done) => {
|
|
const store = configureStore();
|
|
|
|
store.subscribe(() => {
|
|
const password = store.getState().views.login.password;
|
|
assert.equal('password', password);
|
|
done();
|
|
});
|
|
|
|
Actions.handlePasswordChanged('password')(store.dispatch, store.getState);
|
|
});
|
|
});
|