fix store tests (analytics created store before it existed)

This commit is contained in:
Matteo Pagliazzi 2017-09-09 15:05:26 +02:00
parent 861b78ce8a
commit daca2c7fff
2 changed files with 2 additions and 4 deletions

View file

@ -17,8 +17,6 @@ let ALLOWED_HIT_TYPES = [
'timing',
];
const store = getStore();
function _doesNotHaveRequiredFields (properties) {
if (!isEqual(keys(pick(properties, REQUIRED_FIELDS)), REQUIRED_FIELDS)) {
// @TODO: Log with Winston?
@ -36,6 +34,7 @@ function _doesNotHaveAllowedHitType (properties) {
}
function _gatherUserStats (properties) {
const store = getStore();
const user = store.state.user.data;
const tasks = store.state.tasks.data;
@ -65,6 +64,7 @@ function _gatherUserStats (properties) {
}
export function setUser () {
const store = getStore();
const user = store.state.user.data;
window.amplitude.setUserId(user._id);
window.ga('set', {userId: user._id});

View file

@ -50,8 +50,6 @@ export async function socialAuth (store, params) {
authResponse: params.auth.authResponse,
});
// @TODO: Analytics
let user = result.data.data;
let userLocalData = JSON.stringify({