Improvment in tslint standard (#16)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// - Import react components
|
||||
var expect = require('expect')
|
||||
var df = require('deep-freeze-strict')
|
||||
let expect = require('expect')
|
||||
let df = require('deep-freeze-strict')
|
||||
import { authorizeReducer } from 'authorizeReducer'
|
||||
|
||||
// - Import action types
|
||||
@@ -10,7 +10,7 @@ import * as types from 'actionTypes'
|
||||
/**
|
||||
* Default state
|
||||
*/
|
||||
var defaultState = {
|
||||
let defaultState = {
|
||||
uid: 0,
|
||||
authed: false,
|
||||
updatePassword: false,
|
||||
@@ -19,11 +19,11 @@ var defaultState = {
|
||||
|
||||
describe('authorizeReducer', () => {
|
||||
it('should set user in login state', () => {
|
||||
var action = {
|
||||
let action = {
|
||||
type: types.LOGIN,
|
||||
uid: 'user12345'
|
||||
};
|
||||
var res = authorizeReducer(df(defaultState), df(action));
|
||||
}
|
||||
let res = authorizeReducer(df(defaultState), df(action))
|
||||
|
||||
expect(res.uid).toEqual(action.uid)
|
||||
expect(res.authed).toEqual(true)
|
||||
@@ -31,10 +31,10 @@ describe('authorizeReducer', () => {
|
||||
})
|
||||
|
||||
it('should set user in logout state', () => {
|
||||
var action = {
|
||||
let action = {
|
||||
type: types.LOGOUT
|
||||
};
|
||||
var res = authorizeReducer(df(defaultState), df(action));
|
||||
}
|
||||
let res = authorizeReducer(df(defaultState), df(action))
|
||||
|
||||
expect(res.uid).toEqual(0)
|
||||
expect(res.authed).toEqual(false)
|
||||
@@ -42,21 +42,21 @@ describe('authorizeReducer', () => {
|
||||
})
|
||||
|
||||
it('should set uid in signup', () => {
|
||||
var action = {
|
||||
let action = {
|
||||
type: types.SIGNUP,
|
||||
uid: 'user12345'
|
||||
};
|
||||
var res = authorizeReducer(df(defaultState), df(action));
|
||||
}
|
||||
let res = authorizeReducer(df(defaultState), df(action))
|
||||
|
||||
expect(res.uid).toEqual(action.uid)
|
||||
})
|
||||
|
||||
it('should update password', () => {
|
||||
var action = {
|
||||
let action = {
|
||||
type: types.UPDATE_PASSWORD,
|
||||
updatePassword: 'p@55w0rd'
|
||||
};
|
||||
var res = authorizeReducer(df(defaultState), df(action));
|
||||
}
|
||||
let res = authorizeReducer(df(defaultState), df(action))
|
||||
|
||||
expect(res.updatePassword).toEqual(action.updatePassword)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user